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/history.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/history.test')
-rw-r--r-- | tests/history.test | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/history.test b/tests/history.test new file mode 100644 index 0000000..178a107 --- /dev/null +++ b/tests/history.test @@ -0,0 +1,43 @@ +source [file dirname [info script]]/testing.tcl + +needs cmd history + +test history-1.1 {history usage} -body { + history +} -returnCodes error -result {wrong # args: should be "history command ..." +Use "history -help ?command?" for help} + +test history-1.2 {history -help} -body { + history -help +} -result {Usage: "history command ... ", where command is one of: getline, completion, load, save, add, show} + +test history-1.2 {history add} { + history add line1 + history add "line2 next" + set name tmp.[pid] + history save $name + set f [open $name] + set lines [split [string trimright [read $f]] \n] +} {line1 {line2 next}} + +test history-1.3 {history load} { + history load $name +} {} + +test history-1.4 {history completion usage} -body { + history completion +} -returnCodes error -result {wrong # args: should be "history completion command"} + +test history-1.5 {history completion} { + history completion command +} {} + +test history-1.6 {history completion} { + history completion {} +} {} + +file delete $name + +# Can't really tests history add, show, setcompletion + +testreport |