From bf7629462a2c412cf42480b41f40de1a45e53f11 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sat, 8 Feb 2020 10:38:11 +0100 Subject: [PATCH] Port some small tests to littlecheck --- tests/checks/exec.fish | 13 +++++++++++++ tests/checks/expansion.fish | 6 ++++++ tests/test2.err | 0 tests/test2.in | 6 ------ tests/test2.out | 1 - tests/test_exec_fail.err | 4 ---- tests/test_exec_fail.in | 6 ------ tests/test_exec_fail.out | 2 -- tests/test_exec_fail.status | 1 - 9 files changed, 19 insertions(+), 20 deletions(-) create mode 100644 tests/checks/exec.fish delete mode 100644 tests/test2.err delete mode 100644 tests/test2.in delete mode 100644 tests/test2.out delete mode 100644 tests/test_exec_fail.err delete mode 100644 tests/test_exec_fail.in delete mode 100644 tests/test_exec_fail.out delete mode 100644 tests/test_exec_fail.status diff --git a/tests/checks/exec.fish b/tests/checks/exec.fish new file mode 100644 index 000000000..b7658f1a2 --- /dev/null +++ b/tests/checks/exec.fish @@ -0,0 +1,13 @@ +#RUN: %fish %s +exec cat < nosuchfile +#CHECKERR: warning: An error occurred while redirecting file 'nosuchfile' +#CHECKERR: open: No such file or directory +echo "failed: $status" +#CHECK: failed: 1 +not exec cat < nosuchfile +#CHECKERR: warning: An error occurred while redirecting file 'nosuchfile' +#CHECKERR: open: No such file or directory +echo "neg failed: $status" +#CHECK: neg failed: 0 +exec cat < /dev/null +echo "not reached" diff --git a/tests/checks/expansion.fish b/tests/checks/expansion.fish index d7b7c7805..5c2b26d04 100644 --- a/tests/checks/expansion.fish +++ b/tests/checks/expansion.fish @@ -11,3 +11,9 @@ printf '<%s>\n' ($fish -c 'if $f[a]; end' 2>&1) # CHECK: # CHECK: # CHECK: < ^> + +set a A +set aa AA +set aaa AAA +echo {$aa}a{1,2,3}(for a in 1 2 3; echo $a; end) +#CHECK: AAa11 AAa21 AAa31 AAa12 AAa22 AAa32 AAa13 AAa23 AAa33 diff --git a/tests/test2.err b/tests/test2.err deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/test2.in b/tests/test2.in deleted file mode 100644 index 1aabc9204..000000000 --- a/tests/test2.in +++ /dev/null @@ -1,6 +0,0 @@ -#Tests complex parameter expansions - -set a A -set aa AA -set aaa AAA -echo {$aa}a{1,2,3}(for a in 1 2 3; echo $a; end) diff --git a/tests/test2.out b/tests/test2.out deleted file mode 100644 index e1af60632..000000000 --- a/tests/test2.out +++ /dev/null @@ -1 +0,0 @@ -AAa11 AAa21 AAa31 AAa12 AAa22 AAa32 AAa13 AAa23 AAa33 diff --git a/tests/test_exec_fail.err b/tests/test_exec_fail.err deleted file mode 100644 index e2c8dd99f..000000000 --- a/tests/test_exec_fail.err +++ /dev/null @@ -1,4 +0,0 @@ -warning: An error occurred while redirecting file 'nosuchfile' -open: No such file or directory -warning: An error occurred while redirecting file 'nosuchfile' -open: No such file or directory diff --git a/tests/test_exec_fail.in b/tests/test_exec_fail.in deleted file mode 100644 index 08be53ef4..000000000 --- a/tests/test_exec_fail.in +++ /dev/null @@ -1,6 +0,0 @@ -exec cat < nosuchfile -echo "failed: $status" -not exec cat < nosuchfile -echo "neg failed: $status" -exec cat < /dev/null -echo "not reached" diff --git a/tests/test_exec_fail.out b/tests/test_exec_fail.out deleted file mode 100644 index 762ca2ce2..000000000 --- a/tests/test_exec_fail.out +++ /dev/null @@ -1,2 +0,0 @@ -failed: 1 -neg failed: 0 diff --git a/tests/test_exec_fail.status b/tests/test_exec_fail.status deleted file mode 100644 index 573541ac9..000000000 --- a/tests/test_exec_fail.status +++ /dev/null @@ -1 +0,0 @@ -0