Skip to content

Commit 7fbdf2a

Browse files
committed
update example tests
1 parent 136a7f1 commit 7fbdf2a

File tree

4 files changed

+23
-21
lines changed

4 files changed

+23
-21
lines changed

tests/examples/cat.test

Lines changed: 0 additions & 14 deletions
This file was deleted.

tests/examples/echo.test

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/examples/examples.test

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# 1. Test that the "echo" command (a shell builtin, usually)
2+
# prints its argument on stdout, prints nothing on stderr,
3+
# and exits with a zero exit code.
4+
5+
$ echo a
6+
a
7+
8+
# 2. Test that echo with no arguments prints a blank line,
9+
# no stderr output, and exits with zero.
10+
# Since the output ends with whitespace, this time we must write
11+
# the exit code test (>=) explicitly, to act as a delimiter.
12+
13+
$ echo
14+
15+
>=
16+
17+
# 3. Test that cat with a bad flag prints nothing on stdout,
18+
# an error containing "unrecognized option" or "illegal option" on stderr,
19+
# and exits with non-zero status.
20+
21+
$ cat --no-such-flag
22+
>2 /(unrecognized|illegal) option/
23+
>= !0

tests/print/print-format1.test

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11

2-
$ shelltest --print=v1 tests/examples/cat.test | diff -u - tests/examples/cat.test
3-
4-
$ shelltest --print=v1 tests/examples/echo.test | diff -u - tests/examples/echo.test
5-
62
$ shelltest --print=v1 tests/format1/abstract-test-with-macros | diff -u - tests/format1/abstract-test-with-macros

0 commit comments

Comments
 (0)