Commit graph

24 commits

Author SHA1 Message Date
558ddb4096
wordsplit: return error for unclosed quotes 2025-02-20 15:00:32 +01:00
7806043a98
wordsplit: ensure that mixed broken quotes are handled correctly 2025-02-20 15:00:32 +01:00
452d35acdf
wordsplit: handle mixed quotes 2025-02-20 15:00:32 +01:00
1676cf6696
wordsplit: handle double quotes 2025-02-20 15:00:32 +01:00
5276aba278
wordsplit: handle single quotes 2025-02-20 15:00:32 +01:00
db0abe82cc
tests: also show debug info for succeeding assertions
This reminds us of all the good stuff we already acomplished!
2025-02-20 15:00:32 +01:00
4171a3d07b
wordsplit: handle multiple words 2025-02-20 15:00:11 +01:00
00fd2380cf
wordsplit: handle a sigle word separated surrounded by blanks
a blank here is as defined by POSIX
https://pubs.opengroup.org/onlinepubs/9699919799/
section 7.3.1
2025-02-20 15:00:11 +01:00
8defbf4d13
wordsplit: handle single word with spaces before or after 2025-02-20 14:55:29 +01:00
fc985ea046
fix(tests): also run tests if test program did not change 2025-02-20 14:55:29 +01:00
a083800506
word splitting: a single word is not split
Sorry this commit is a bit big, lots of groudwork is being established here
2025-02-20 14:55:29 +01:00
871571e258
tests: more clear output log 2025-02-20 14:47:31 +01:00
dff68d5a8b
env refactor: split imports over multiple files
This allows for potentially faster recompilation, by not triggering
recompilation for all env files if env_manip changes
2025-02-19 16:43:37 +01:00
e445f668b3
env_manip: sort funcs per structure that is being manipulated
This is instead of the operation that is being performed.

I find it more logical this way, but if you prefer we can keep it as-is.

I also put the identifier_isvalid func into parser/matchers
2025-02-19 14:47:10 +01:00
Jérôme Guélen
e985fcc562 env_set_entry: use ft_errno to indicate error conditions 2025-02-19 14:34:09 +01:00
Jérôme Guélen
660d785237 ENV: A small set of functions for internal env 2025-02-19 14:34:09 +01:00
18a2835a7c
tests: add testutils 2025-02-19 14:34:09 +01:00
ab6a4d6368
envp_get_val: add tests + make it more consistent with envp_get_key
In particular, this is what is now changed:
 - if line is null or empty, return null
 - if line contains no =, return an empty string

This way, if non-null is returned, that means that line was valid. If null is
returned, there is either an error with line, or malloc failed.
2025-02-19 14:34:09 +01:00
af90bec318
envp_get_key: fix buffer overflow if line contains no '=' 2025-02-19 14:34:09 +01:00
9ac8588518
envp_get_key: add tests 2025-02-19 14:34:09 +01:00
c7a86eecfd
tests: tests can now use libft 2025-02-19 14:34:08 +01:00
6e1552a35d
fix: ';' is not a metacharacter
Co-authored-by: jguelen <jguelen@student.42lehavre.fr>
2025-02-11 19:04:05 +01:00
e877b8dbd5
fix(tests): correctly handle dependencies in test makefile 2025-02-11 18:47:46 +01:00
Khaïs COLIN
60d9b212fb
tests: add infrastructure for writing tests in C 2025-02-07 15:29:43 +01:00