- for user
-
Download binary file from releases page.
https://github.com/liquidz/shelltest/releases - for developer
-
go get github.com/liquidz/shelltest
example/hello.txt
bash$ echo hello shelltest hello shelltest bash$ echo $? 0
run shelltest
$ shelltest example/hello.txt .. 2 tests, 0 failures
Default formatter
$ shelltest example/fail.txt 0) (exit 1); echo $? command : (exit 1); echo $? expected: [{equals 0}] actual : 1 x. 2 tests, 1 failures
Tap formatter
$ shelltest -f tap example/fail.txt 1..2 not ok 1 - (exit 1); echo $? ok 2 - echo foo
Auto assertion
# ok $ (exit 0) # ng $ (exit 1)
To disable auto assertion, use --no-auto-assertion
option.
Equal assertion
# ok $ echo foo foo # ng $ echo foo bar
Not equal assertion
# ok $ echo foo != bar # ng $ echo foo != foo
Match assertion
# ok $ echo foo =~ fo* # ng =~ ba*
Not match assertion
# ok $ echo foo !~ ooo # ng !~ oo
-
Syntax highlight for
*.shelltest
Copyright © uochan
Distributed under the MIT License.