git @ Cat's Eye Technologies Falderal / 78e6346
Space is a shell metacharacter. Remove quotes from test commands. Chris Pressey 3 years ago
6 changed file(s) with 12 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
571571 # shell metacharacter, and escape it. Note that we have to handle
572572 # backslashes first, lest we escape backslashes we just added in.
573573 value = value.replace('\\', '\\\\')
574 for c in """><*?[]'"`$()|;&#""":
574 for c in """ ><*?[]'"`$()|;&#""":
575575 value = value.replace(c, '\\' + c)
576576 return command.replace(var_name, value)
577577
1212 -> shell command "python cat.py -o %(output-file)"
1313
1414 -> Functionality "Cat" is implemented by
15 -> shell command "python echo.py '%(test-body-text)'"
15 -> shell command "python echo.py %(test-body-text)"
55 to be on `stdout`.
66
77 -> Functionality "Error on stdout" is implemented by shell command
8 -> "python fail.py '%(test-body-text)' '' 1"
8 -> "python fail.py %(test-body-text) '' 1"
99
1010 -> Tests for functionality "Error on stdout"
1111
44 expected text is matched against standard output.
55
66 -> Functionality "Succeed" is implemented by shell command
7 -> "python fail.py '%(test-body-text)' bar 0"
7 -> "python fail.py %(test-body-text) bar 0"
88
99 -> Tests for functionality "Succeed"
1010
1515 output and standard error, it's up to you to redirect them.
1616
1717 -> Functionality "Succeed/All" is implemented by shell command
18 -> "python fail.py '%(test-body-text)' bar 0 2>&1"
18 -> "python fail.py %(test-body-text) bar 0 2>&1"
1919
2020 -> Tests for functionality "Succeed/All"
2121
2727 expected text is matched against standard error.
2828
2929 -> Functionality "Fail" is implemented by shell command
30 -> "python fail.py foo '%(test-body-text)' 1"
30 -> "python fail.py foo %(test-body-text) 1"
3131
3232 -> Tests for functionality "Fail"
3333
3838 output and standard error, it's up to you to redirect them.
3939
4040 -> Functionality "Fail/All" is implemented by shell command
41 -> "python fail.py foo '%(test-body-text)' 1 1>&2"
41 -> "python fail.py foo %(test-body-text) 1 1>&2"
4242
4343 -> Tests for functionality "Fail/All"
4444
66 the expected error text.
77
88 -> Functionality "Fail" is implemented by shell command
9 -> "python fail.py foo '%(test-body-text)' 1"
9 -> "python fail.py foo %(test-body-text) 1"
1010
1111 -> Tests for functionality "Fail"
1212
1515 | hello
1616 = hello
1717
18 FIXME: this does not work for now, because the newline is not escaped,
19 so the command runs over two lines, and it thinks `hi` is a shell command.
20
21 > | hi
22 > | hi
23 > = hi
24 > = hi
25
2618 | hi
19 | hi
20 = hi
2721 = hi
2822
2923 -> Functionality "Echo, no newline" is implemented by
3428 | hello
3529 = hello
3630
37 FIXME: this does not work for now, because the newline is not escaped,
38 so the command runs over two lines, and it thinks `hi` is a shell command.
39
40 > | hi
41 > | hi
42 > = hi
43 > = hi
44
4531 | hi
32 | hi
33 = hi
4634 = hi
4735
4836 Note that when variables are expanded, backslash sequences in the