Test Issue with "Backslash within single quotes #le5" for Go

I’m getting a fail in the test script for something I think my program is parsing correctly. Why would the two quotes after test lead to one combined argument instead of two?

Blockquote
remote: [your-program] $ echo “shell script” “test”“example”
remote: [your-program] shell script test example
remote: [tester::#TG6] Output does not match expected value.
remote: [tester::#TG6] Expected: “shell script testexample”
remote: [tester::#TG6] Received: “shell script test example”
remote: [your-program] $
remote: [tester::#TG6] Assertion failed.
remote: [tester::#TG6] Test failed

Because that is how the bash shell parses it.

Read number #2 on Shell Operation (Bash Reference Manual). “Tokens” are separated by (unquoted) metacharacters, but " is not a metacharacter, so "test""example" resolves to the piece test followed by example, and since there is no space (metacharacter) between they become one single token testexample.

1 Like

Thanks for the explanation! :folded_hands: