diff options
| -rw-r--r-- | tests/048.sh | 20 | ||||
| -rw-r--r-- | tests/test_diff.sh | 2 |
2 files changed, 21 insertions, 1 deletions
diff --git a/tests/048.sh b/tests/048.sh new file mode 100644 index 0000000..76b500f --- /dev/null +++ b/tests/048.sh @@ -0,0 +1,20 @@ +set -e + +cat <<'EOF' > expected +argc = 4 +argv[1] = hoge +argv[2] = piyo +argv[3] = fuga +EOF +bash ../../test_diff.sh hoge piyo fuga<<'EOF' +int printf(); + +int main(int argc, char** argv) { + printf("argc = %d\n", argc); + int i; + for (i = 1; i < argc; ++i) { + printf("argv[%d] = %s\n", i, argv[i]); + } + return 0; +} +EOF diff --git a/tests/test_diff.sh b/tests/test_diff.sh index ec0f1d0..8e938de 100644 --- a/tests/test_diff.sh +++ b/tests/test_diff.sh @@ -9,7 +9,7 @@ gcc -Wl,-z,noexecstack -o a.out main.s if [[ ! -f input ]]; then touch input fi -./a.out < input > output +./a.out "$@" < input > output exit_code=$? if [[ $exit_code -ne 0 ]]; then |
