diff options
author | Grissiom <chaos.proton@gmail.com> | 2010-10-03 11:46:26 +0800 |
---|---|---|
committer | Grissiom <chaos.proton@gmail.com> | 2010-10-03 11:46:26 +0800 |
commit | 27df727ca11dfeac74214609771eacfccd4d5c08 (patch) | |
tree | 20147ec14a1c4abe7e2548597e69b3a8848f3050 /tests | |
parent | 8910226d2f63db6fc7256b388187a249c9384478 (diff) |
don't parse the options that should be passed to fish scripts
This commit makes fish_parse_opt stop at first non-option argument,
which expected as fish script name and pass the remaining argument to
that script. I also updated the test cases.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test.fish | 37 | ||||
-rw-r--r-- | tests/top.err | 6 | ||||
-rw-r--r-- | tests/top.out | 6 | ||||
-rw-r--r-- | tests/top.status | 1 |
4 files changed, 50 insertions, 0 deletions
diff --git a/tests/test.fish b/tests/test.fish index 74e562b9..610c966e 100755 --- a/tests/test.fish +++ b/tests/test.fish @@ -4,6 +4,43 @@ # instad of using autotest to provide additional # testing for fish. :-) + +if [ "$argv" != '-n' ] + # begin...end has bug in error redirecting... + begin + ../fish -n ./test.fish ^top.tmp.err + ../fish -n ./test.fish -n ^^top.tmp.err + ../fish ./test.fish -n ^^top.tmp.err + end | tee top.tmp.out + echo $status >top.tmp.status + set res ok + if diff top.tmp.out top.out >/dev/null + else + set res fail + echo Output differs for file test.fish + end + + if diff top.tmp.err top.err >/dev/null + else + set res fail + echo Error output differs for file test.fish + end + + if test (cat top.tmp.status) = (cat top.status) + else + set res fail + echo Exit status differs for file test.fish + end + + if test $res = ok; + echo File test.fish tested ok + else + echo File test.fish failed tests + end; + + exit +end + echo Testing high level script functionality for i in *.in diff --git a/tests/top.err b/tests/top.err new file mode 100644 index 00000000..73a623c4 --- /dev/null +++ b/tests/top.err @@ -0,0 +1,6 @@ +fish: Expected redirection specification, got token of type '$i' +/usr/local/src/grissioms-fish-shell/tests/test.fish (line 51): ../fish <$i >tmp.out ^tmp.err + ^ +fish: Expected redirection specification, got token of type '$i' +/usr/local/src/grissioms-fish-shell/tests/test.fish (line 51): ../fish <$i >tmp.out ^tmp.err + ^ diff --git a/tests/top.out b/tests/top.out new file mode 100644 index 00000000..c3a60ba6 --- /dev/null +++ b/tests/top.out @@ -0,0 +1,6 @@ +Testing high level script functionality +File test1.in tested ok +File test2.in tested ok +File test3.in tested ok +File test4.in tested ok +File test5.in tested ok diff --git a/tests/top.status b/tests/top.status new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/tests/top.status @@ -0,0 +1 @@ +0 |