commit 13fbc8fd10abea66171d93ab308edb01e0ab6f93 parent 34cab1d7301317c8add52bb141bf712c989f39bb Author: Sebastian <sebastian@sebsite.pw> Date: Mon, 21 Feb 2022 14:02:28 -0500 shlex: use `raw strings` in tests This improves readability. Signed-off-by: Sebastian <sebastian@sebsite.pw> Diffstat:
M | shlex/+test.ha | | | 20 | ++++++++++---------- |
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/shlex/+test.ha b/shlex/+test.ha @@ -3,25 +3,25 @@ use strings; @test fn split() void = { - const s = split("hello\\ world")!; + const s = split(`hello\ world`)!; defer strings::freeall(s); assert(len(s) == 1); assert(s[0] == "hello world"); - const s = split("'hello\\ world'")!; + const s = split(`'hello\ world'`)!; defer strings::freeall(s); assert(len(s) == 1); - assert(s[0] == "hello\\ world"); + assert(s[0] == `hello\ world`); - const s = split("\"hello\\\\world\"")!; + const s = split(`"hello\\world"`)!; defer strings::freeall(s); assert(len(s) == 1); - assert(s[0] == "hello\\world"); + assert(s[0] == `hello\world`); - const s = split("\"hello \"'\"'\"world\"'\"'")!; + const s = split(`"hello "'"'"world"'"'`)!; defer strings::freeall(s); assert(len(s) == 1); - assert(s[0] == "hello \"world\""); + assert(s[0] == `hello "world"`); const s = split("hello '' world")!; defer strings::freeall(s); @@ -42,7 +42,7 @@ use strings; assert(s[0] == "Leading"); assert(s[1] == "spaces"); - const s = split("with\\ backslashes 'single quoted' \"double quoted\"")!; + const s = split(`with\ backslashes 'single quoted' "double quoted"`)!; defer strings::freeall(s); assert(len(s) == 3); assert(s[0] == "with backslashes"); @@ -56,7 +56,7 @@ use strings; assert(s[1] == "42"); // Invalid - assert(split("\"dangling double quote") is syntaxerr); + assert(split(`"dangling double quote`) is syntaxerr); assert(split("'dangling single quote") is syntaxerr); - assert(split("unterminated\\ backslash \\") is syntaxerr); + assert(split(`unterminated\ backslash \`) is syntaxerr); };