diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-10-26 15:07:03 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-10-26 15:07:03 (GMT) |
commit | 34d3750e3ce6bd9d08b641e6f99b992ad80740b1 (patch) | |
tree | 26a8f502102bfcadba52f027e82956d3886ca679 /tests/string.test | |
parent | 1c788e178d149302a1d9d5265bc46120de4f5a6a (diff) | |
download | tcl-34d3750e3ce6bd9d08b641e6f99b992ad80740b1.zip tcl-34d3750e3ce6bd9d08b641e6f99b992ad80740b1.tar.gz tcl-34d3750e3ce6bd9d08b641e6f99b992ad80740b1.tar.bz2 |
Fix [48898ab5f6a0d957]: Too few is better than not enough? (Inconsistent error messages)
Diffstat (limited to 'tests/string.test')
-rw-r--r-- | tests/string.test | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/string.test b/tests/string.test index 12108ca..18faa51 100644 --- a/tests/string.test +++ b/tests/string.test @@ -37,7 +37,7 @@ test string-1.2 {error conditions} { list [catch {string} msg] $msg } {1 {wrong # args: should be "string subcommand ?arg ...?"}} -test string-2.1 {string compare, too few args} { +test string-2.1 {string compare, not enough args} { list [catch {string compare a} msg] $msg } {1 {wrong # args: should be "string compare ?-nocase? ?-length int? string1 string2"}} test string-2.2 {string compare, bad args} { @@ -177,7 +177,7 @@ test string-3.8 {string equal with length, unequal strings} { string equal -length 2 abc abde } 1 -test string-4.1 {string first, too few args} { +test string-4.1 {string first, not enough args} { list [catch {string first a} msg] $msg } {1 {wrong # args: should be "string first needleString haystackString ?startIndex?"}} test string-4.2 {string first, bad args} { @@ -321,10 +321,10 @@ proc largest_int {} { return [expr {$int-1}] } -test string-6.1 {string is, too few args} { +test string-6.1 {string is, not enough args} { list [catch {string is} msg] $msg } {1 {wrong # args: should be "string is class ?-strict? ?-failindex var? str"}} -test string-6.2 {string is, too few args} { +test string-6.2 {string is, not enough args} { list [catch {string is alpha} msg] $msg } {1 {wrong # args: should be "string is class ?-strict? ?-failindex var? str"}} test string-6.3 {string is, bad args} { @@ -774,7 +774,7 @@ test string-6.131 {string is entier, false on bad hex} { catch {rename largest_int {}} -test string-7.1 {string last, too few args} { +test string-7.1 {string last, not enough args} { list [catch {string last a} msg] $msg } {1 {wrong # args: should be "string last needleString haystackString ?startIndex?"}} test string-7.2 {string last, bad args} { @@ -860,7 +860,7 @@ test string-9.7 {string length, bytearray object} { string length [binary format I* {0x50515253 0x52}] } 8 -test string-10.1 {string map, too few args} { +test string-10.1 {string map, not enough args} { list [catch {string map} msg] $msg } {1 {wrong # args: should be "string map ?-nocase? charMap string"}} test string-10.2 {string map, bad args} { @@ -960,7 +960,7 @@ test string-10.31 {string map, nasty sharing crash from [Bug 1018562]} { string map $a $a } {b b} -test string-11.1 {string match, too few args} { +test string-11.1 {string match, not enough args} { list [catch {string match a} msg] $msg } {1 {wrong # args: should be "string match ?-nocase? pattern string"}} test string-11.2 {string match, too many args} { @@ -1404,7 +1404,7 @@ test string-14.19 {string replace} { string replace {} -1 0 A } A -test string-15.1 {string tolower too few args} { +test string-15.1 {string tolower not enough args} { list [catch {string tolower} msg] $msg } {1 {wrong # args: should be "string tolower string ?first? ?last?"}} test string-15.2 {string tolower bad args} { @@ -1839,7 +1839,7 @@ test string-25.14 {string is list} { list [string is list -failindex x "\uABCD {b c}d e"] $x } {0 2} -test string-26.1 {tcl::prefix, too few args} -body { +test string-26.1 {tcl::prefix, not enough args} -body { tcl::prefix match a } -returnCodes 1 -result {wrong # args: should be "tcl::prefix match ?options? table string"} test string-26.2 {tcl::prefix, bad args} -body { @@ -1966,7 +1966,7 @@ test string-26.13 {tcl::prefix: testing for leaks} -body { } } -constraints memory -result {0} -test string-27.1 {tcl::prefix all, too few args} -body { +test string-27.1 {tcl::prefix all, not enough args} -body { tcl::prefix all a } -returnCodes 1 -result {wrong # args: should be "tcl::prefix all table string"} test string-27.2 {tcl::prefix all, bad args} -body { @@ -1997,7 +1997,7 @@ test string-27.10 {tcl::prefix all} { tcl::prefix all {apa aska appa} {} } {apa aska appa} -test string-28.1 {tcl::prefix longest, too few args} -body { +test string-28.1 {tcl::prefix longest, not enough args} -body { tcl::prefix longest a } -returnCodes 1 -result {wrong # args: should be "tcl::prefix longest table string"} test string-28.2 {tcl::prefix longest, bad args} -body { |