diff options
author | Steve Bennett <steveb@workware.net.au> | 2020-04-18 09:34:25 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2020-05-04 21:57:34 +1000 |
commit | da82368c816c8d06f425aa3f25a2a918fdba1df1 (patch) | |
tree | e1dc05358910d168edc982ed05523d0b30ad24d5 /tests/jimsh.test | |
parent | 8a5861eb51c32e41d638181188c256c1dbb93c96 (diff) | |
download | jimtcl-da82368c816c8d06f425aa3f25a2a918fdba1df1.zip jimtcl-da82368c816c8d06f425aa3f25a2a918fdba1df1.tar.gz jimtcl-da82368c816c8d06f425aa3f25a2a918fdba1df1.tar.bz2 |
tests: Add many new additional tests for code coverage
readdir, tty, utf8, signal, alarm, kill, file, jimsh, posix, aio,
history, interp, pack, unpack, eventloop, exec, load, package,
regexp, regsub
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/jimsh.test')
-rw-r--r-- | tests/jimsh.test | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/jimsh.test b/tests/jimsh.test new file mode 100644 index 0000000..eabd248 --- /dev/null +++ b/tests/jimsh.test @@ -0,0 +1,40 @@ +source [file dirname [info script]]/testing.tcl + +needs constraint jim + +test jimsh-1.1 {jimsh --help} -body { + exec [info nameofexecutable] --help +} -match glob -result {jimsh version *Usage: *} + +test jimsh-1.2 {jimsh -} { + exec [info nameofexecutable] - << {puts $(1 + 2)} +} {3} + +test jimsh-1.3 {jimsh - arg list} jim { + exec [info nameofexecutable] - arg list << {puts [join $argv]} +} {arg list} + +test jimsh-1.4 {jimsh -e} { + exec [info nameofexecutable] -e {expr {4 + 5}} +} {9} + +test jimsh-1.4 {jimsh -e with args} { + exec [info nameofexecutable] -e {set argv} arg1 arg2 +} {arg1 arg2} + +test jimsh-1.5 {jimsh --version} { + exec [info nameofexecutable] --version +} [info version] + +test jimsh-1.6 {jimsh -e with error} -body { + exec [info nameofexecutable] -e blah +} -returnCodes error -result {invalid command name "blah"} + +test jimsh-1.7 {jimsh prompt} -body { + exec [info nameofexecutable] << "set x 3\nincr x\nexit \$x\n" +} -returnCodes error -match glob -result {Welcome to Jim version * +. 3 +. 4 +. } + +testreport |