diff options
author | Evan Hunter <evan@ozhiker.com> | 2016-09-29 23:09:15 +0100 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2016-10-02 09:27:58 +1000 |
commit | 890be1129b7f65c1a1840ee4fa89c07b13a360a6 (patch) | |
tree | f33444f21f552d7e3327f21d18cb6fe783ced6a7 /tests | |
parent | 3dddadf4e41cdd3c64a920c60991766ab7141650 (diff) | |
download | jimtcl-890be1129b7f65c1a1840ee4fa89c07b13a360a6.zip jimtcl-890be1129b7f65c1a1840ee4fa89c07b13a360a6.tar.gz jimtcl-890be1129b7f65c1a1840ee4fa89c07b13a360a6.tar.bz2 |
Add some tests for paths identified as untested by gcov.
Also prune a 'break' which was unreachable.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/format.test | 4 | ||||
-rw-r--r-- | tests/prefix.test | 6 | ||||
-rw-r--r-- | tests/regexp.test | 8 |
3 files changed, 18 insertions, 0 deletions
diff --git a/tests/format.test b/tests/format.test index 6a9ce85..bc3e461 100644 --- a/tests/format.test +++ b/tests/format.test @@ -508,6 +508,10 @@ test format-16.4 {format %b} { format %b 1234567 } {100101101011010000111} +test format-16.5 {format %b} { + list [catch {format %b badvalue} msg] $msg +} {1 {expected integer but got "badvalue"}} + # cleanup catch {unset a} catch {unset b} diff --git a/tests/prefix.test b/tests/prefix.test index 1540f75..1fbe653 100644 --- a/tests/prefix.test +++ b/tests/prefix.test @@ -20,6 +20,9 @@ testConstraint namespace [expr {[info commands namespace] ne ""}] test string-26.1 {tcl::prefix, too few args} -body { tcl::prefix match a } -returnCodes 1 -match glob -result {wrong # args: should be "tcl::prefix match ?options*? table string"} +test string-26.1.1 {tcl::prefix, too few args} -body { + tcl::prefix +} -returnCodes 1 -match glob -result {wrong # args: should be "tcl::prefix subcommand ?arg ...?"} test string-26.2 {tcl::prefix, bad args} -body { tcl::prefix match a b c } -returnCodes 1 -result {bad option "a": must be -error, -exact, or -message} @@ -27,6 +30,9 @@ test string-26.2.1 {tcl::prefix, empty table} -body { tcl::prefix match {} foo } -returnCodes 1 -result {bad option "foo": no valid options} +test string-26.2.2 {tcl::prefix, bad args} -body { + tcl::prefix badoption +} -returnCodes 1 -result {bad option "badoption": must be all, longest, or match} test string-26.3.1 {tcl::prefix, bad args} -body { diff --git a/tests/regexp.test b/tests/regexp.test index 94107eb..2e9b13e 100644 --- a/tests/regexp.test +++ b/tests/regexp.test @@ -222,6 +222,10 @@ test regexp-6.8 {regexp errors} jim { test regexp-6.9 {regexp errors, -start bad int check} { list [catch {regexp -start bogus {^$} {}} msg] $msg } {1 {bad index "bogus": must be integer?[+-]integer? or end?[+-]integer?}} +test regexp-6.10 {regexp errors, -start too few args} { + list [catch {regexp -all -start} msg] $msg +} {1 {wrong # args: should be "regexp ?-switch ...? exp string ?matchVar? ?subMatchVar ...?"}} + test regexp-7.1 {basic regsub operation} { list [regsub aa+ xaxaaaxaa 111&222 foo] $foo @@ -388,6 +392,10 @@ test regexp-11.11 {regsub without final variable name returns value} { test regexp-11.12 {regsub without final variable name returns value} { regsub -all b(\[^d\]*)d abcdeabcfde {,&,\1,} } {a,bcd,c,ea,bcfd,cf,e} +test regexp-11.13 {regsub errors, -start too few args} { + list [catch {regsub -all -nocase -nocase -start} msg] $msg +} {1 {wrong # args: should be "regsub ?-switch ...? exp string subSpec ?varName?"}} + # This test crashes on the Mac unless you increase the Stack Space to about 1 # Meg. This is probably bigger than most users want... |