diff --git a/tests/should_succeed/ascii_test.jou b/tests/should_succeed/ascii_test.jou index 1b0d332c..a3d57ebf 100644 --- a/tests/should_succeed/ascii_test.jou +++ b/tests/should_succeed/ascii_test.jou @@ -1,4 +1,6 @@ import "stdlib/ascii.jou" +import "stdlib/io.jou" +import "stdlib/mem.jou" import "stdlib/str.jou" def main() -> int: @@ -35,9 +37,20 @@ def main() -> int: assert not is_ascii_whitespace('.') assert not is_ascii_whitespace('\0') - s: byte[100] - strcpy(s, " hello world \r\n \t ") + s: byte[100] = " hello world \r\n \t " trim_ascii_whitespace(s) assert strcmp(s, "hello world") == 0 + s = " hello world \r\n \t " + words = split_by_ascii_whitespace(s) + # Output: hello + # Output: world + for w = words; *w != NULL; w++: + puts(*w) + # Output: hello + # Output: world + for i = 0; words[i] != NULL; i++: + puts(words[i]) + free(words) + return 0