From 2f19ec1c34da30a9b33c34843ebd17f3e83e7f5f Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 26 Jun 2019 18:57:10 +0200 Subject: [PATCH] Port count test to littlecheck --- tests/{count.in => checks/count.fish} | 24 ++++++++++++++++------ tests/count.err | 18 ----------------- tests/count.out | 29 --------------------------- 3 files changed, 18 insertions(+), 53 deletions(-) rename tests/{count.in => checks/count.fish} (66%) delete mode 100644 tests/count.err delete mode 100644 tests/count.out diff --git a/tests/count.in b/tests/checks/count.fish similarity index 66% rename from tests/count.in rename to tests/checks/count.fish index e0a1480ed..c66afbfcd 100644 --- a/tests/count.in +++ b/tests/checks/count.fish @@ -1,22 +1,31 @@ +#RUN: %fish %s # Validate the behavior of the `count` command. -logmsg no args +# no args count +# CHECK: 0 -logmsg one args +# one args count x +# CHECK: 1 -logmsg two args +# two args count x y +# CHECK: 2 -logmsg args that look like flags or are otherwise special +# args that look like flags or are otherwise special count -h +# CHECK: 1 count --help +# CHECK: 1 count -- +# CHECK: 1 count -- abc +# CHECK: 2 count def -- abc +# CHECK: 3 -logmsg big counts +# big counts # See #5611 for i in seq 500 @@ -28,11 +37,14 @@ for i in seq 500 end end -logmsg stdin +# stdin # Reading from stdin still counts the arguments printf '%s\n' 1 2 3 4 5 | count 6 7 8 9 10 +# CHECK: 10 # Reading from stdin counts newlines - like `wc -l`. echo -n 0 | count +# CHECK: 0 echo 1 | count +# CHECK: 1 diff --git a/tests/count.err b/tests/count.err deleted file mode 100644 index 333edb967..000000000 --- a/tests/count.err +++ /dev/null @@ -1,18 +0,0 @@ - -#################### -# no args - -#################### -# one args - -#################### -# two args - -#################### -# args that look like flags or are otherwise special - -#################### -# big counts - -#################### -# stdin diff --git a/tests/count.out b/tests/count.out deleted file mode 100644 index c53b726d4..000000000 --- a/tests/count.out +++ /dev/null @@ -1,29 +0,0 @@ - -#################### -# no args -0 - -#################### -# one args -1 - -#################### -# two args -2 - -#################### -# args that look like flags or are otherwise special -1 -1 -1 -2 -3 - -#################### -# big counts - -#################### -# stdin -10 -0 -1