Tcl Source Code

Check-in [1f55c24720]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:merge 8.7
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1f55c24720ad2aba39f246823aa23dfc5a1e8cf028330014f556444cb2f5df0b
User & Date: dgp 2018-03-20 19:58:27
Context
2018-03-24
10:22
Update TZ info to tzdata2018d. check-in: 4432824433 user: jima tags: trunk
2018-03-20
19:58
merge 8.7 check-in: 1f55c24720 user: dgp tags: trunk
19:54
TIP 503 implementation. check-in: ae29ed9c7f user: dgp tags: core-8-branch
2018-03-15
21:02
Merge-mark (here makefile.vc still had the correct CRLF line-endings) check-in: 31c9cac2cb user: jan.nijtmans tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to generic/tclStringObj.c.

  3599   3599   			    INT_MAX));
  3600   3600   		    Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
  3601   3601   		}
  3602   3602   		return NULL;
  3603   3603   	    }
  3604   3604   	    result = Tcl_NewByteArrayObj(NULL, numBytes - count + newBytes);
  3605   3605   								/* PANIC? */
         3606  +	    Tcl_SetByteArrayLength(result, 0);
  3606   3607   	    TclAppendBytesToByteArray(result, bytes, first);	
  3607   3608   	    TclAppendBytesToByteArray(result, iBytes, newBytes);
  3608   3609   	    TclAppendBytesToByteArray(result, bytes + first + count,
  3609   3610   		    numBytes - count - first);
  3610   3611   	    return result;
  3611   3612   	}
  3612   3613   

Changes to tests/basic.test.

   666    666   set l1 [list a {b b} c d]
   667    667   set l2 [list e f {g g} h]
   668    668   proc l3 {} {
   669    669       list i j k {l l}
   670    670   }
   671    671   
   672    672   # Do all tests once byte compiled and once with direct string evaluation
   673         -for {set noComp 0} {$noComp <= 1} {incr noComp} {
          673  +foreach noComp {0 1} {
   674    674   
   675    675   if $noComp {
   676    676       interp alias {} run {} testevalex
   677    677       set constraints testevalex
   678    678   } else {
   679    679       interp alias {} run {} if 1
   680    680       set constraints {}

Changes to tests/compile.test.

   495    495   test compile-15.4 {proper TCL_RETURN code from [return]} {
   496    496       apply {{} {catch {return [info library]}}}
   497    497   } 2
   498    498   test compile-15.5 {proper TCL_RETURN code from [return]} {
   499    499       apply {{} {catch {set a 1}; return}}
   500    500   } ""
   501    501   
   502         -for {set noComp 0} {$noComp <= 1} {incr noComp} {
          502  +# Do all tests once byte compiled and once with direct string evaluation
          503  +foreach noComp {0 1} {
   503    504   
   504    505   if $noComp {
   505    506       interp alias {} run {} testevalex
   506    507       set constraints testevalex
   507    508   } else {
   508    509       interp alias {} run {} if 1
   509    510       set constraints {}

Changes to tests/string.test.

    16     16       package require tcltest
    17     17       namespace import -force ::tcltest::*
    18     18   }
    19     19   
    20     20   ::tcltest::loadTestedCommands
    21     21   catch [list package require -exact Tcltest [info patchlevel]]
    22     22   
           23  +# Helper commands to test various optimizations, code paths, and special cases.
           24  +proc makeByteArray {s} {binary format a* $s}
           25  +proc makeUnicode {s} {lindex [regexp -inline .* $s] 0}
           26  +proc makeList {args} {return $args}
           27  +proc makeShared {s} {uplevel 1 [list lappend copy $s]; return $s}
           28  +
    23     29   # Some tests require the testobj command
    24     30   
    25         -testConstraint testobj [expr {[info commands testobj] != {}}]
    26         -testConstraint testindexobj [expr {[info commands testindexobj] != {}}]
           31  +testConstraint testobj [expr {[info commands testobj] ne {}}]
           32  +testConstraint testindexobj [expr {[info commands testindexobj] ne {}}]
           33  +testConstraint testevalex [expr {[info commands testevalex] ne {}}]
    27     34   testConstraint fullutf [expr {[format %c 0x010000] != "\ufffd"}]
    28     35   
    29     36   # Used for constraining memory leak tests
    30     37   testConstraint memory [llength [info commands memory]]
           38  +if {[testConstraint memory]} {
           39  +    proc getbytes {} {
           40  +        set lines [split [memory info] \n]
           41  +        return [lindex $lines 3 3]
           42  +    }
           43  +    proc leaktest {script {iterations 3}} {
           44  +        set end [getbytes]
           45  +        for {set i 0} {$i < $iterations} {incr i} {
           46  +            uplevel 1 $script
           47  +            set tmp $end
           48  +            set end [getbytes]
           49  +        }
           50  +        return [expr {$end - $tmp}]
           51  +    }
           52  +}
    31     53   
    32     54   proc representationpoke s {
    33     55       set r [::tcl::unsupported::representation $s]
    34     56       list [lindex $r 3] [string match {*, string representation "*"} $r]
    35     57   }
           58  +
           59  +foreach noComp {0 1} {
           60  +
           61  +if {$noComp} {
           62  +    if {[info commands testevalex] eq {}} {
           63  +	test string-0.1.$noComp "show testevalex availability" {testevalex} {list} {}
           64  +	continue
           65  +    }
           66  +    interp alias {} run {} testevalex
           67  +    set constraints testevalex
           68  +} else {
           69  +    interp alias {} run {} try
           70  +    set constraints {}
           71  +}
           72  +
    36     73   
    37         -test string-1.1 {error conditions} {
    38         -    list [catch {string gorp a b} msg] $msg
           74  +test string-1.1.$noComp {error conditions} {
           75  +    list [catch {run {string gorp a b}} msg] $msg
    39     76   } {1 {unknown or ambiguous subcommand "gorp": must be bytelength, cat, compare, equal, first, index, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart}}
    40         -test string-1.2 {error conditions} {
    41         -    list [catch {string} msg] $msg
           77  +test string-1.2.$noComp {error conditions} {
           78  +    list [catch {run {string}} msg] $msg
    42     79   } {1 {wrong # args: should be "string subcommand ?arg ...?"}}
           80  +test stringComp-1.3.$noComp {error condition - undefined method during compile} {
           81  +    # We don't want this to complain about 'never' because it may never
           82  +    # be called, or string may get redefined.  This must compile OK.
           83  +    proc foo {str i} {
           84  +        if {"yes" == "no"} { string never called but complains here }
           85  +        string index $str $i
           86  +    }
           87  +    foo abc 0
           88  +} a
    43     89   
    44         -test string-2.1 {string compare, too few args} {
    45         -    list [catch {string compare a} msg] $msg
           90  +test string-2.1.$noComp {string compare, too few args} {
           91  +    list [catch {run {string compare a}} msg] $msg
    46     92   } {1 {wrong # args: should be "string compare ?-nocase? ?-length int? string1 string2"}}
    47         -test string-2.2 {string compare, bad args} {
    48         -    list [catch {string compare a b c} msg] $msg
           93  +test string-2.2.$noComp {string compare, bad args} {
           94  +    list [catch {run {string compare a b c}} msg] $msg
    49     95   } {1 {bad option "a": must be -nocase or -length}}
    50         -test string-2.3 {string compare, bad args} {
    51         -    list [catch {string compare -length -nocase str1 str2} msg] $msg
           96  +test string-2.3.$noComp {string compare, bad args} {
           97  +    list [catch {run {string compare -length -nocase str1 str2}} msg] $msg
    52     98   } {1 {expected integer but got "-nocase"}}
    53         -test string-2.4 {string compare, too many args} {
    54         -    list [catch {string compare -length 10 -nocase str1 str2 str3} msg] $msg
           99  +test string-2.4.$noComp {string compare, too many args} {
          100  +    list [catch {run {string compare -length 10 -nocase str1 str2 str3}} msg] $msg
    55    101   } {1 {wrong # args: should be "string compare ?-nocase? ?-length int? string1 string2"}}
    56         -test string-2.5 {string compare with length unspecified} {
    57         -    list [catch {string compare -length 10 10} msg] $msg
          102  +test string-2.5.$noComp {string compare with length unspecified} {
          103  +    list [catch {run {string compare -length 10 10}} msg] $msg
    58    104   } {1 {wrong # args: should be "string compare ?-nocase? ?-length int? string1 string2"}}
    59         -test string-2.6 {string compare} {
    60         -    string compare abcde abdef
          105  +test string-2.6.$noComp {string compare} {
          106  +    run {string compare abcde abdef}
    61    107   } -1
    62         -test string-2.7 {string compare, shortest method name} {
    63         -    string co abcde ABCDE
          108  +test string-2.7.$noComp {string compare, shortest method name} {
          109  +    run {string co abcde ABCDE}
    64    110   } 1
    65         -test string-2.8 {string compare} {
    66         -    string compare abcde abcde
          111  +test string-2.8.$noComp {string compare} {
          112  +    run {string compare abcde abcde}
    67    113   } 0
    68         -test string-2.9 {string compare with length} {
    69         -    string compare -length 2 abcde abxyz
          114  +test string-2.9.$noComp {string compare with length} {
          115  +    run {string compare -length 2 abcde abxyz}
    70    116   } 0
    71         -test string-2.10 {string compare with special index} {
    72         -    list [catch {string compare -length end-3 abcde abxyz} msg] $msg
          117  +test string-2.10.$noComp {string compare with special index} {
          118  +    list [catch {run {string compare -length end-3 abcde abxyz}} msg] $msg
    73    119   } {1 {expected integer but got "end-3"}}
    74         -test string-2.11 {string compare, unicode} {
    75         -    string compare ab\u7266 ab\u7267
          120  +test string-2.11.$noComp {string compare, unicode} {
          121  +    run {string compare ab\u7266 ab\u7267}
    76    122   } -1
    77         -test string-2.12 {string compare, high bit} {
          123  +test string-2.11.1.$noComp {string compare, unicode} {
          124  +    run {string compare \334 \u00dc}
          125  +} 0
          126  +test string-2.11.2.$noComp {string compare, unicode} {
          127  +    run {string compare \334 \u00fc}
          128  +} -1
          129  +test string-2.11.3.$noComp {string compare, unicode} {
          130  +    run {string compare \334\334\334\374\374 \334\334\334\334\334}
          131  +} 1
          132  +test string-2.12.$noComp {string compare, high bit} {
    78    133       # This test will fail if the underlying comparaison
    79    134       # is using signed chars instead of unsigned chars.
    80    135       # (like SunOS's default memcmp thus the compat/memcmp.c)
    81         -    string compare "\x80" "@"
          136  +    run {string compare "\x80" "@"}
    82    137       # Nb this tests works also in utf8 space because \x80 is
    83    138       # translated into a 2 or more bytelength but whose first byte has
    84    139       # the high bit set.
    85    140   } 1
    86         -test string-2.13 {string compare -nocase} {
    87         -    string compare -nocase abcde abdef
          141  +test string-2.13.$noComp {string compare -nocase} {
          142  +    run {string compare -nocase abcde abdef}
    88    143   } -1
    89         -test string-2.14 {string compare -nocase} {
    90         -    string compare -nocase abcde ABCDE
          144  +test string-2.13.1.$noComp {string compare -nocase} {
          145  +    run {string compare -nocase abcde Abdef}
          146  +} -1
          147  +test string-2.14.$noComp {string compare -nocase} {
          148  +    run {string compare -nocase abcde ABCDE}
    91    149   } 0
    92         -test string-2.15 {string compare -nocase} {
    93         -    string compare -nocase abcde abcde
          150  +test string-2.15.$noComp {string compare -nocase} {
          151  +    run {string compare -nocase abcde abcde}
    94    152   } 0
    95         -test string-2.16 {string compare -nocase with length} {
    96         -    string compare -length 2 -nocase abcde Abxyz
          153  +test string-2.15.1.$noComp {string compare -nocase} {
          154  +    run {string compare -nocase \334 \u00dc}
    97    155   } 0
    98         -test string-2.17 {string compare -nocase with length} {
    99         -    string compare -nocase -length 3 abcde Abxyz
          156  +test string-2.15.2.$noComp {string compare -nocase} {
          157  +    run {string compare -nocase \334\334\334\374\u00fc \334\334\334\334\334}
          158  +} 0
          159  +test string-2.16.$noComp {string compare -nocase with length} {
          160  +    run {string compare -length 2 -nocase abcde Abxyz}
          161  +} 0
          162  +test string-2.17.$noComp {string compare -nocase with length} {
          163  +    run {string compare -nocase -length 3 abcde Abxyz}
          164  +} -1
          165  +test string-2.18.$noComp {string compare -nocase with length <= 0} {
          166  +    run {string compare -nocase -length -1 abcde AbCdEf}
   100    167   } -1
   101         -test string-2.18 {string compare -nocase with length <= 0} {
   102         -    string compare -nocase -length -1 abcde AbCdEf
   103         -} -1
   104         -test string-2.19 {string compare -nocase with excessive length} {
   105         -    string compare -nocase -length 50 AbCdEf abcde
          168  +test string-2.19.$noComp {string compare -nocase with excessive length} {
          169  +    run {string compare -nocase -length 50 AbCdEf abcde}
   106    170   } 1
   107         -test string-2.20 {string compare -len unicode} {
          171  +test string-2.20.$noComp {string compare -len unicode} {
   108    172       # These are strings that are 6 BYTELENGTH long, but the length
   109    173       # shouldn't make a different because there are actually 3 CHARS long
   110         -    string compare -len 5 \334\334\334 \334\334\374
          174  +    run {string compare -len 5 \334\334\334 \334\334\374}
   111    175   } -1
   112         -test string-2.21 {string compare -nocase with special index} {
   113         -    list [catch {string compare -nocase -length end-3 Abcde abxyz} msg] $msg
          176  +test string-2.21.$noComp {string compare -nocase with special index} {
          177  +    list [catch {run {string compare -nocase -length end-3 Abcde abxyz}} msg] $msg
   114    178   } {1 {expected integer but got "end-3"}}
   115         -test string-2.22 {string compare, null strings} {
   116         -    string compare "" ""
          179  +test string-2.22.$noComp {string compare, null strings} {
          180  +    run {string compare "" ""}
   117    181   } 0
   118         -test string-2.23 {string compare, null strings} {
   119         -    string compare "" foo
          182  +test string-2.23.$noComp {string compare, null strings} {
          183  +    run {string compare "" foo}
   120    184   } -1
   121         -test string-2.24 {string compare, null strings} {
   122         -    string compare foo ""
          185  +test string-2.24.$noComp {string compare, null strings} {
          186  +    run {string compare foo ""}
   123    187   } 1
   124         -test string-2.25 {string compare -nocase, null strings} {
   125         -    string compare -nocase "" ""
          188  +test string-2.25.$noComp {string compare -nocase, null strings} {
          189  +    run {string compare -nocase "" ""}
   126    190   } 0
   127         -test string-2.26 {string compare -nocase, null strings} {
   128         -    string compare -nocase "" foo
          191  +test string-2.26.$noComp {string compare -nocase, null strings} {
          192  +    run {string compare -nocase "" foo}
   129    193   } -1
   130         -test string-2.27 {string compare -nocase, null strings} {
   131         -    string compare -nocase foo ""
          194  +test string-2.27.$noComp {string compare -nocase, null strings} {
          195  +    run {string compare -nocase foo ""}
   132    196   } 1
   133         -test string-2.28 {string compare with length, unequal strings} {
   134         -    string compare -length 2 abc abde
          197  +test string-2.28.$noComp {string compare with length, unequal strings} {
          198  +    run {string compare -length 2 abc abde}
   135    199   } 0
   136         -test string-2.29 {string compare with length, unequal strings} {
   137         -    string compare -length 2 ab abde
          200  +test string-2.29.$noComp {string compare with length, unequal strings} {
          201  +    run {string compare -length 2 ab abde}
   138    202   } 0
   139         -test string-2.30 {string compare with NUL character vs. other ASCII} {
          203  +test string-2.30.$noComp {string compare with NUL character vs. other ASCII} {
   140    204       # Be careful here, since UTF-8 rep comparison with memcmp() of
   141    205       # these puts chars in the wrong order
   142         -    string compare \x00 \x01
          206  +    run {string compare \x00 \x01}
          207  +} -1
          208  +test string-2.31.$noComp {string compare, high bit} {
          209  +    run {string compare "a\x80" "[email protected]"}
          210  +} 1
          211  +test string-2.32.$noComp {string compare, high bit} {
          212  +    run {string compare "a\x00" "a\x01"}
   143    213   } -1
   144         -test string-2.31 {string compare, high bit} {
   145         -    proc foo {} {string compare "a\x80" "[email protected]"}
   146         -    foo
   147         -} 1
   148         -test string-2.32 {string compare, high bit} {
   149         -    proc foo {} {string compare "a\x00" "a\x01"}
   150         -    foo
          214  +test string-2.33.$noComp {string compare, high bit} {
          215  +    run {string compare "\x00\x00" "\x00\x01"}
   151    216   } -1
   152         -test string-2.33 {string compare, high bit} {
   153         -    proc foo {} {string compare "\x00\x00" "\x00\x01"}
   154         -    foo
   155         -} -1
          217  +test string-2.34.$noComp {string compare, binary equal} {
          218  +    run {string compare [binary format a100 0] [binary format a100 0]}
          219  +} 0
          220  +test string-2.35.$noComp {string compare, binary neq} {
          221  +    run {string compare [binary format a100a 0 1] [binary format a100a 0 0]}
          222  +} 1
          223  +test string-2.36.$noComp {string compare, binary neq unequal length} {
          224  +    run {string compare [binary format a20a 0 1] [binary format a100a 0 0]}
          225  +} 1
   156    226   
   157    227   # only need a few tests on equal, since it uses the same code as
   158    228   # string compare, but just modifies the return output
   159         -test string-3.1 {string equal} {
   160         -    string equal abcde abdef
   161         -} 0
   162         -test string-3.2 {string equal} {
   163         -    string eq abcde ABCDE
   164         -} 0
   165         -test string-3.3 {string equal} {
   166         -    string equal abcde abcde
   167         -} 1
   168         -test string-3.4 {string equal -nocase} {
   169         -    string equal -nocase \334\334\334\334\374\374\374\374 \334\334\334\334\334\334\334\334
   170         -} 1
   171         -test string-3.5 {string equal -nocase} {
   172         -    string equal -nocase abcde abdef
   173         -} 0
   174         -test string-3.6 {string equal -nocase} {
   175         -    string eq -nocase abcde ABCDE
   176         -} 1
   177         -test string-3.7 {string equal -nocase} {
   178         -    string equal -nocase abcde abcde
   179         -} 1
   180         -test string-3.8 {string equal with length, unequal strings} {
   181         -    string equal -length 2 abc abde
   182         -} 1
   183         -
   184         -test string-4.1 {string first, too few args} {
   185         -    list [catch {string first a} msg] $msg
          229  +test string-3.1.$noComp {string equal} {
          230  +    run {string equal abcde abdef}
          231  +} 0
          232  +test string-3.2.$noComp {string equal} {
          233  +    run {string e abcde ABCDE}
          234  +} 0
          235  +test string-3.3.$noComp {string equal} {
          236  +    run {string equal abcde abcde}
          237  +} 1
          238  +test string-3.4.$noComp {string equal -nocase} {
          239  +    run {string equal -nocase \334\334\334\334\374\374\374\374 \334\334\334\334\334\334\334\334}
          240  +} 1
          241  +test string-3.5.$noComp {string equal -nocase} {
          242  +    run {string equal -nocase abcde abdef}
          243  +} 0
          244  +test string-3.6.$noComp {string equal -nocase} {
          245  +    run {string eq -nocase abcde ABCDE}
          246  +} 1
          247  +test string-3.7.$noComp {string equal -nocase} {
          248  +    run {string equal -nocase abcde abcde}
          249  +} 1
          250  +test string-3.8.$noComp {string equal with length, unequal strings} {
          251  +    run {string equal -length 2 abc abde}
          252  +} 1
          253  +test string-3.9.$noComp {string equal, too few args} {
          254  +    list [catch {run {string equal a}} msg] $msg
          255  +} {1 {wrong # args: should be "string equal ?-nocase? ?-length int? string1 string2"}}
          256  +test string-3.10.$noComp {string equal, bad args} {
          257  +    list [catch {run {string equal a b c}} msg] $msg
          258  +} {1 {bad option "a": must be -nocase or -length}}
          259  +test string-3.11.$noComp {string equal, bad args} {
          260  +    list [catch {run {string equal -length -nocase str1 str2}} msg] $msg
          261  +} {1 {expected integer but got "-nocase"}}
          262  +test string-3.12.$noComp {string equal, too many args} {
          263  +    list [catch {run {string equal -length 10 -nocase str1 str2 str3}} msg] $msg
          264  +} {1 {wrong # args: should be "string equal ?-nocase? ?-length int? string1 string2"}}
          265  +test string-3.13.$noComp {string equal with length unspecified} {
          266  +    list [catch {run {string equal -length 10 10}} msg] $msg
          267  +} {1 {wrong # args: should be "string equal ?-nocase? ?-length int? string1 string2"}}
          268  +test string-3.14.$noComp {string equal with length} {
          269  +    run {string equal -length 2 abcde abxyz}
          270  +} 1
          271  +test string-3.15.$noComp {string equal with special index} {
          272  +    list [catch {run {string equal -length end-3 abcde abxyz}} msg] $msg
          273  +} {1 {expected integer but got "end-3"}}
          274  +
          275  +test string-3.16.$noComp {string equal, unicode} {
          276  +    run {string equal ab\u7266 ab\u7267}
          277  +} 0
          278  +test string-3.17.$noComp {string equal, unicode} {
          279  +    run {string equal \334 \u00dc}
          280  +} 1
          281  +test string-3.18.$noComp {string equal, unicode} {
          282  +    run {string equal \334 \u00fc}
          283  +} 0 
          284  +test string-3.19.$noComp {string equal, unicode} {
          285  +    run {string equal \334\334\334\374\374 \334\334\334\334\334}
          286  +} 0
          287  +test string-3.20.$noComp {string equal, high bit} {
          288  +    # This test will fail if the underlying comparaison
          289  +    # is using signed chars instead of unsigned chars.
          290  +    # (like SunOS's default memcmp thus the compat/memcmp.c)
          291  +    run {string equal "\x80" "@"}
          292  +    # Nb this tests works also in utf8 space because \x80 is
          293  +    # translated into a 2 or more bytelength but whose first byte has
          294  +    # the high bit set.
          295  +} 0
          296  +test string-3.21.$noComp {string equal -nocase} {
          297  +    run {string equal -nocase abcde Abdef}
          298  +} 0
          299  +test string-3.22.$noComp {string equal, -nocase unicode} {
          300  +    run {string equal -nocase \334 \u00dc}
          301  +} 1
          302  +test string-3.23.$noComp {string equal, -nocase unicode} {
          303  +    run {string equal -nocase \334\334\334\374\u00fc \334\334\334\334\334}
          304  +} 1
          305  +test string-3.24.$noComp {string equal -nocase with length} {
          306  +    run {string equal -length 2 -nocase abcde Abxyz}
          307  +} 1
          308  +test string-3.25.$noComp {string equal -nocase with length} {
          309  +    run {string equal -nocase -length 3 abcde Abxyz}
          310  +} 0 
          311  +test string-3.26.$noComp {string equal -nocase with length <= 0} {
          312  +    run {string equal -nocase -length -1 abcde AbCdEf}
          313  +} 0
          314  +test string-3.27.$noComp {string equal -nocase with excessive length} {
          315  +    run {string equal -nocase -length 50 AbCdEf abcde}
          316  +} 0
          317  +test string-3.28.$noComp {string equal -len unicode} {
          318  +    # These are strings that are 6 BYTELENGTH long, but the length
          319  +    # shouldn't make a different because there are actually 3 CHARS long
          320  +    run {string equal -len 5 \334\334\334 \334\334\374}
          321  +} 0
          322  +test string-3.29.$noComp {string equal -nocase with special index} {
          323  +    list [catch {run {string equal -nocase -length end-3 Abcde abxyz}} msg] $msg
          324  +} {1 {expected integer but got "end-3"}}
          325  +test string-3.30.$noComp {string equal, null strings} {
          326  +    run {string equal "" ""}
          327  +} 1
          328  +test string-3.31.$noComp {string equal, null strings} {
          329  +    run {string equal "" foo}
          330  +} 0
          331  +test string-3.32.$noComp {string equal, null strings} {
          332  +    run {string equal foo ""}
          333  +} 0
          334  +test string-3.33.$noComp {string equal -nocase, null strings} {
          335  +    run {string equal -nocase "" ""}
          336  +} 1
          337  +test string-3.34.$noComp {string equal -nocase, null strings} {
          338  +    run {string equal -nocase "" foo}
          339  +} 0
          340  +test string-3.35.$noComp {string equal -nocase, null strings} {
          341  +    run {string equal -nocase foo ""}
          342  +} 0
          343  +test string-3.36.$noComp {string equal with NUL character vs. other ASCII} {
          344  +    # Be careful here, since UTF-8 rep comparison with memcmp() of
          345  +    # these puts chars in the wrong order
          346  +    run {string equal \x00 \x01}
          347  +} 0
          348  +test string-3.37.$noComp {string equal, high bit} {
          349  +    run {string equal "a\x80" "[email protected]"}
          350  +} 0
          351  +test string-3.38.$noComp {string equal, high bit} {
          352  +    run {string equal "a\x00" "a\x01"}
          353  +} 0
          354  +test string-3.39.$noComp {string equal, high bit} {
          355  +    run {string equal "a\x00\x00" "a\x00\x01"}
          356  +} 0
          357  +test string-3.40.$noComp {string equal, binary equal} {
          358  +    run {string equal [binary format a100 0] [binary format a100 0]}
          359  +} 1
          360  +test string-3.41.$noComp {string equal, binary neq} {
          361  +    run {string equal [binary format a100a 0 1] [binary format a100a 0 0]}
          362  +} 0
          363  +test string-3.42.$noComp {string equal, binary neq inequal length} {
          364  +    run {string equal [binary format a20a 0 1] [binary format a100a 0 0]}
          365  +} 0
          366  +
          367  +
          368  +test string-4.1.$noComp {string first, too few args} {
          369  +    list [catch {run {string first a}} msg] $msg
   186    370   } {1 {wrong # args: should be "string first needleString haystackString ?startIndex?"}}
   187         -test string-4.2 {string first, bad args} {
   188         -    list [catch {string first a b c} msg] $msg
          371  +test string-4.2.$noComp {string first, bad args} {
          372  +    list [catch {run {string first a b c}} msg] $msg
   189    373   } {1 {bad index "c": must be integer?[+-]integer? or end?[+-]integer?}}
   190         -test string-4.3 {string first, too many args} {
   191         -    list [catch {string first a b 5 d} msg] $msg
          374  +test string-4.3.$noComp {string first, too many args} {
          375  +    list [catch {run {string first a b 5 d}} msg] $msg
   192    376   } {1 {wrong # args: should be "string first needleString haystackString ?startIndex?"}}
   193         -test string-4.4 {string first} {
   194         -    string first bq abcdefgbcefgbqrs
          377  +test string-4.4.$noComp {string first} {
          378  +    run {string first bq abcdefgbcefgbqrs}
   195    379   } 12
   196         -test string-4.5 {string first} {
   197         -    string fir bcd abcdefgbcefgbqrs
          380  +test string-4.5.$noComp {string first} {
          381  +    run {string fir bcd abcdefgbcefgbqrs}
   198    382   } 1
   199         -test string-4.6 {string first} {
   200         -    string f b abcdefgbcefgbqrs
          383  +test string-4.6.$noComp {string first} {
          384  +    run {string f b abcdefgbcefgbqrs}
   201    385   } 1
   202         -test string-4.7 {string first} {
   203         -    string first xxx x123xx345xxx789xxx012
          386  +test string-4.7.$noComp {string first} {
          387  +    run {string first xxx x123xx345xxx789xxx012}
   204    388   } 9
   205         -test string-4.8 {string first} {
   206         -    string first "" x123xx345xxx789xxx012
          389  +test string-4.8.$noComp {string first} {
          390  +    run {string first "" x123xx345xxx789xxx012}
   207    391   } -1
   208         -test string-4.9 {string first, unicode} {
   209         -    string first x abc\u7266x
          392  +test string-4.9.$noComp {string first, unicode} {
          393  +    run {string first x abc\u7266x}
   210    394   } 4
   211         -test string-4.10 {string first, unicode} {
   212         -    string first \u7266 abc\u7266x
          395  +test string-4.10.$noComp {string first, unicode} {
          396  +    run {string first \u7266 abc\u7266x}
   213    397   } 3
   214         -test string-4.11 {string first, start index} {
   215         -    string first \u7266 abc\u7266x 3
          398  +test string-4.11.$noComp {string first, start index} {
          399  +    run {string first \u7266 abc\u7266x 3}
   216    400   } 3
   217         -test string-4.12 {string first, start index} {
   218         -    string first \u7266 abc\u7266x 4
          401  +test string-4.12.$noComp {string first, start index} {
          402  +    run {string first \u7266 abc\u7266x 4}
   219    403   } -1
   220         -test string-4.13 {string first, start index} {
   221         -    string first \u7266 abc\u7266x end-2
          404  +test string-4.13.$noComp {string first, start index} {
          405  +    run {string first \u7266 abc\u7266x end-2}
   222    406   } 3
   223         -test string-4.14 {string first, negative start index} {
   224         -    string first b abc -1
          407  +test string-4.14.$noComp {string first, negative start index} {
          408  +    run {string first b abc -1}
   225    409   } 1
   226         -test string-4.15 {string first, ability to two-byte encoded utf-8 chars} {
          410  +test string-4.15.$noComp {string first, ability to two-byte encoded utf-8 chars} {
   227    411       # Test for a bug in Tcl 8.3 where test for all-single-byte-encoded
   228    412       # strings was incorrect, leading to an index returned by [string first]
   229    413       # which pointed past the end of the string.
   230    414       set uchar \u057e    ;# character with two-byte encoding in utf-8
   231         -    string first % %#$uchar$uchar#$uchar$uchar#% 3
          415  +    run {string first % %#$uchar$uchar#$uchar$uchar#% 3}
   232    416   } 8
   233         -test string-4.16 {string first, normal string vs pure unicode string} {
          417  +test string-4.16.$noComp {string first, normal string vs pure unicode string} {
   234    418       set s hello
   235    419       regexp ll $s m
   236    420       # Representation checks are canaries
   237         -    list [representationpoke $s] [representationpoke $m] \
   238         -	[string first $m $s]
          421  +    run {list [representationpoke $s] [representationpoke $m] \
          422  +	[string first $m $s]}
   239    423   } {{string 1} {string 0} 2}
   240    424   
   241         -test string-5.1 {string index} {
   242         -    list [catch {string index} msg] $msg
          425  +test string-5.1.$noComp {string index} {
          426  +    list [catch {run {string index}} msg] $msg
   243    427   } {1 {wrong # args: should be "string index string charIndex"}}
   244         -test string-5.2 {string index} {
   245         -    list [catch {string index a b c} msg] $msg
          428  +test string-5.2.$noComp {string index} {
          429  +    list [catch {run {string index a b c}} msg] $msg
   246    430   } {1 {wrong # args: should be "string index string charIndex"}}
   247         -test string-5.3 {string index} {
   248         -    string index abcde 0
          431  +test string-5.3.$noComp {string index} {
          432  +    run {string index abcde 0}
   249    433   } a
   250         -test string-5.4 {string index} {
   251         -    string in abcde 4
          434  +test string-5.4.$noComp {string index} {
          435  +    run {string ind abcde 4}
   252    436   } e
   253         -test string-5.5 {string index} {
   254         -    string index abcde 5
          437  +test string-5.5.$noComp {string index} {
          438  +    run {string index abcde 5}
   255    439   } {}
   256         -test string-5.6 {string index} {
   257         -    list [catch {string index abcde -10} msg] $msg
          440  +test string-5.6.$noComp {string index} {
          441  +    list [catch {run {string index abcde -10}} msg] $msg
   258    442   } {0 {}}
   259         -test string-5.7 {string index} {
   260         -    list [catch {string index a xyz} msg] $msg
          443  +test string-5.7.$noComp {string index} {
          444  +    list [catch {run {string index a xyz}} msg] $msg
   261    445   } {1 {bad index "xyz": must be integer?[+-]integer? or end?[+-]integer?}}
   262         -test string-5.8 {string index} {
   263         -    string index abc end
          446  +test string-5.8.$noComp {string index} {
          447  +    run {string index abc end}
   264    448   } c
   265         -test string-5.9 {string index} {
   266         -    string index abc end-1
          449  +test string-5.9.$noComp {string index} {
          450  +    run {string index abc end-1}
   267    451   } b
   268         -test string-5.10 {string index, unicode} {
   269         -    string index abc\u7266d 4
          452  +test string-5.10.$noComp {string index, unicode} {
          453  +    run {string index abc\u7266d 4}
   270    454   } d
   271         -test string-5.11 {string index, unicode} {
   272         -    string index abc\u7266d 3
          455  +test string-5.11.$noComp {string index, unicode} {
          456  +    run {string index abc\u7266d 3}
   273    457   } \u7266
   274         -test string-5.12 {string index, unicode over char length, under byte length} {
   275         -    string index \334\374\334\374 6
          458  +test string-5.12.$noComp {string index, unicode over char length, under byte length} {
          459  +    run {string index \334\374\334\374 6}
   276    460   } {}
   277         -test string-5.13 {string index, bytearray object} {
   278         -    string index [binary format a5 fuz] 0
          461  +test string-5.13.$noComp {string index, bytearray object} {
          462  +    run {string index [binary format a5 fuz] 0}
   279    463   } f
   280         -test string-5.14 {string index, bytearray object} {
   281         -    string index [binary format I* {0x50515253 0x52}] 3
          464  +test string-5.14.$noComp {string index, bytearray object} {
          465  +    run {string index [binary format I* {0x50515253 0x52}] 3}
   282    466   } S
   283         -test string-5.15 {string index, bytearray object} {
          467  +test string-5.15.$noComp {string index, bytearray object} {
   284    468       set b [binary format I* {0x50515253 0x52}]
   285         -    set i1 [string index $b end-6]
   286         -    set i2 [string index $b 1]
   287         -    string compare $i1 $i2
          469  +    set i1 [run {string index $b end-6}]
          470  +    set i2 [run {string index $b 1}]
          471  +    run {string compare $i1 $i2}
   288    472   } 0
   289         -test string-5.16 {string index, bytearray object with string obj shimmering} {
          473  +test string-5.16.$noComp {string index, bytearray object with string obj shimmering} {
   290    474       set str "0123456789\x00 abcdedfghi"
   291    475       binary scan $str H* dump
   292         -    string compare [string index $str 10] \x00
          476  +    run {string compare [run {string index $str 10}] \x00}
   293    477   } 0
   294         -test string-5.17 {string index, bad integer} -body {
   295         -    list [catch {string index "abc" 0o8} msg] $msg
          478  +test string-5.17.$noComp {string index, bad integer} -body {
          479  +    list [catch {run {string index "abc" 0o8}} msg] $msg
   296    480   } -match glob -result {1 {*}}
   297         -test string-5.18 {string index, bad integer} -body {
   298         -    list [catch {string index "abc" end-0o0289} msg] $msg
          481  +test string-5.18.$noComp {string index, bad integer} -body {
          482  +    list [catch {run {string index "abc" end-0o0289}} msg] $msg
   299    483   } -match glob -result {1 {*}}
   300         -test string-5.19 {string index, bytearray object out of bounds} {
   301         -    string index [binary format I* {0x50515253 0x52}] -1
          484  +test string-5.19.$noComp {string index, bytearray object out of bounds} {
          485  +    run {string index [binary format I* {0x50515253 0x52}] -1}
   302    486   } {}
   303         -test string-5.20 {string index, bytearray object out of bounds} {
   304         -    string index [binary format I* {0x50515253 0x52}] 20
          487  +test string-5.20.$noComp {string index, bytearray object out of bounds} {
          488  +    run {string index [binary format I* {0x50515253 0x52}] 20}
   305    489   } {}
   306    490   
   307    491   
   308    492   proc largest_int {} {
   309    493       # This will give us what the largest valid int on this machine is,
   310    494       # so we can test for overflow properly below on >32 bit systems
   311    495       set int 1
   312    496       set exp 7; # assume we get at least 8 bits
   313    497       while {wide($int) > 0} { set int [expr {wide(1) << [incr exp]}] }
   314    498       return [expr {$int-1}]
   315    499   }
   316    500   
   317         -test string-6.1 {string is, too few args} {
   318         -    list [catch {string is} msg] $msg
          501  +test string-6.1.$noComp {string is, too few args} {
          502  +    list [catch {run {string is}} msg] $msg
   319    503   } {1 {wrong # args: should be "string is class ?-strict? ?-failindex var? str"}}
   320         -test string-6.2 {string is, too few args} {
   321         -    list [catch {string is alpha} msg] $msg
          504  +test string-6.2.$noComp {string is, too few args} {
          505  +    list [catch {run {string is alpha}} msg] $msg
   322    506   } {1 {wrong # args: should be "string is class ?-strict? ?-failindex var? str"}}
   323         -test string-6.3 {string is, bad args} {
   324         -    list [catch {string is alpha -failin str} msg] $msg
          507  +test string-6.3.$noComp {string is, bad args} {
          508  +    list [catch {run {string is alpha -failin str}} msg] $msg
   325    509   } {1 {wrong # args: should be "string is alpha ?-strict? ?-failindex var? str"}}
   326         -test string-6.4 {string is, too many args} {
   327         -    list [catch {string is alpha -failin var -strict str more} msg] $msg
          510  +test string-6.4.$noComp {string is, too many args} {
          511  +    list [catch {run {string is alpha -failin var -strict str more}} msg] $msg
   328    512   } {1 {wrong # args: should be "string is class ?-strict? ?-failindex var? str"}}
   329         -test string-6.5 {string is, class check} {
   330         -    list [catch {string is bogus str} msg] $msg
          513  +test string-6.5.$noComp {string is, class check} {
          514  +    list [catch {run {string is bogus str}} msg] $msg
   331    515   } {1 {bad class "bogus": must be alnum, alpha, ascii, control, boolean, digit, double, entier, false, graph, integer, list, lower, print, punct, space, true, upper, wideinteger, wordchar, or xdigit}}
   332         -test string-6.6 {string is, ambiguous class} {
   333         -    list [catch {string is al str} msg] $msg
          516  +test string-6.6.$noComp {string is, ambiguous class} {
          517  +    list [catch {run {string is al str}} msg] $msg
   334    518   } {1 {ambiguous class "al": must be alnum, alpha, ascii, control, boolean, digit, double, entier, false, graph, integer, list, lower, print, punct, space, true, upper, wideinteger, wordchar, or xdigit}}
   335         -test string-6.7 {string is alpha, all ok} {
   336         -    string is alpha -strict -failindex var abc
          519  +test string-6.7.$noComp {string is alpha, all ok} {
          520  +    run {string is alpha -strict -failindex var abc}
   337    521   } 1
   338         -test string-6.8 {string is, error in var} {
   339         -    list [string is alpha -failindex var abc5def] $var
          522  +test string-6.8.$noComp {string is, error in var} {
          523  +    list [run {string is alpha -failindex var abc5def}] $var
   340    524   } {0 3}
   341         -test string-6.9 {string is, var shouldn't get set} {
          525  +test string-6.9.$noComp {string is, var shouldn't get set} {
   342    526       catch {unset var}
   343         -    list [catch {string is alpha -failindex var abc; set var} msg] $msg
          527  +    list [catch {run {string is alpha -failindex var abc; set var}} msg] $msg
   344    528   } {1 {can't read "var": no such variable}}
   345         -test string-6.10 {string is, ok on empty} {
   346         -    string is alpha {}
          529  +test string-6.10.$noComp {string is, ok on empty} {
          530  +    run {string is alpha {}}
   347    531   } 1
   348         -test string-6.11 {string is, -strict check against empty} {
   349         -    string is alpha -strict {}
          532  +test string-6.11.$noComp {string is, -strict check against empty} {
          533  +    run {string is alpha -strict {}}
   350    534   } 0
   351         -test string-6.12 {string is alnum, true} {
   352         -    string is alnum abc123
          535  +test string-6.12.$noComp {string is alnum, true} {
          536  +    run {string is alnum abc123}
   353    537   } 1
   354         -test string-6.13 {string is alnum, false} {
   355         -    list [string is alnum -failindex var abc1.23] $var
          538  +test string-6.13.$noComp {string is alnum, false} {
          539  +    list [run {string is alnum -failindex var abc1.23}] $var
   356    540   } {0 4}
   357         -test string-6.14 {string is alnum, unicode} "string is alnum abc\xfc" 1
   358         -test string-6.15 {string is alpha, true} {
   359         -    string is alpha abc
          541  +test string-6.14.$noComp {string is alnum, unicode} "run {string is alnum abc\xfc}" 1
          542  +test string-6.15.$noComp {string is alpha, true} {
          543  +    run {string is alpha abc}
   360    544   } 1
   361         -test string-6.16 {string is alpha, false} {
   362         -    list [string is alpha -fail var a1bcde] $var
          545  +test string-6.16.$noComp {string is alpha, false} {
          546  +    list [run {string is alpha -fail var a1bcde}] $var
   363    547   } {0 1}
   364         -test string-6.17 {string is alpha, unicode} {
   365         -    string is alpha abc\374
          548  +test string-6.17.$noComp {string is alpha, unicode} {
          549  +    run {string is alpha abc\374}
   366    550   } 1
   367         -test string-6.18 {string is ascii, true} {
   368         -    string is ascii abc\u007Fend\u0000
          551  +test string-6.18.$noComp {string is ascii, true} {
          552  +    run {string is ascii abc\u007Fend\u0000}
   369    553   } 1
   370         -test string-6.19 {string is ascii, false} {
   371         -    list [string is ascii -fail var abc\u0000def\u0080more] $var
          554  +test string-6.19.$noComp {string is ascii, false} {
          555  +    list [run {string is ascii -fail var abc\u0000def\u0080more}] $var
   372    556   } {0 7}
   373         -test string-6.20 {string is boolean, true} {
   374         -    string is boolean true
          557  +test string-6.20.$noComp {string is boolean, true} {
          558  +    run {string is boolean true}
   375    559   } 1
   376         -test string-6.21 {string is boolean, true} {
   377         -    string is boolean f
          560  +test string-6.21.$noComp {string is boolean, true} {
          561  +    run {string is boolean f}
   378    562   } 1
   379         -test string-6.22 {string is boolean, true based on type} {
   380         -    string is bool [string compare a a]
          563  +test string-6.22.$noComp {string is boolean, true based on type} {
          564  +    run {string is bool [run {string compare a a}]}
   381    565   } 1
   382         -test string-6.23 {string is boolean, false} {
   383         -    list [string is bool -fail var yada] $var
          566  +test string-6.23.$noComp {string is boolean, false} {
          567  +    list [run {string is bool -fail var yada}] $var
   384    568   } {0 0}
   385         -test string-6.24 {string is digit, true} {
   386         -    string is digit 0123456789
          569  +test string-6.24.$noComp {string is digit, true} {
          570  +    run {string is digit 0123456789}
   387    571   } 1
   388         -test string-6.25 {string is digit, false} {
   389         -    list [string is digit -fail var 0123\u00dc567] $var
          572  +test string-6.25.$noComp {string is digit, false} {
          573  +    list [run {string is digit -fail var 0123\u00dc567}] $var
   390    574   } {0 4}
   391         -test string-6.26 {string is digit, false} {
   392         -    list [string is digit -fail var +123567] $var
   393         -} {0 0}
   394         -test string-6.27 {string is double, true} {
   395         -    string is double 1
   396         -} 1
   397         -test string-6.28 {string is double, true} {
   398         -    string is double [expr double(1)]
   399         -} 1
   400         -test string-6.29 {string is double, true} {
   401         -    string is double 1.0
   402         -} 1
   403         -test string-6.30 {string is double, true} {
   404         -    string is double [string compare a a]
   405         -} 1
   406         -test string-6.31 {string is double, true} {
   407         -    string is double "   +1.0e-1  "
   408         -} 1
   409         -test string-6.32 {string is double, true} {
   410         -    string is double "\n1.0\v"
   411         -} 1
   412         -test string-6.33 {string is double, false} {
   413         -    list [string is double -fail var 1abc] $var
          575  +test string-6.26.$noComp {string is digit, false} {
          576  +    list [run {string is digit -fail var +123567}] $var
          577  +} {0 0}
          578  +test string-6.27.$noComp {string is double, true} {
          579  +    run {string is double 1}
          580  +} 1
          581  +test string-6.28.$noComp {string is double, true} {
          582  +    run {string is double [expr double(1)]}
          583  +} 1
          584  +test string-6.29.$noComp {string is double, true} {
          585  +    run {string is double 1.0}
          586  +} 1
          587  +test string-6.30.$noComp {string is double, true} {
          588  +    run {string is double [run {string compare a a}]}
          589  +} 1
          590  +test string-6.31.$noComp {string is double, true} {
          591  +    run {string is double "   +1.0e-1  "}
          592  +} 1
          593  +test string-6.32.$noComp {string is double, true} {
          594  +    run {string is double "\n1.0\v"}
          595  +} 1
          596  +test string-6.33.$noComp {string is double, false} {
          597  +    list [run {string is double -fail var 1abc}] $var
   414    598   } {0 1}
   415         -test string-6.34 {string is double, false} {
   416         -    list [string is double -fail var abc] $var
          599  +test string-6.34.$noComp {string is double, false} {
          600  +    list [run {string is double -fail var abc}] $var
   417    601   } {0 0}
   418         -test string-6.35 {string is double, false} {
   419         -    list [string is double -fail var "   1.0e4e4  "] $var
          602  +test string-6.35.$noComp {string is double, false} {
          603  +    list [run {string is double -fail var "   1.0e4e4  "}] $var
   420    604   } {0 8}
   421         -test string-6.36 {string is double, false} {
   422         -    list [string is double -fail var "\n"] $var
          605  +test string-6.36.$noComp {string is double, false} {
          606  +    list [run {string is double -fail var "\n"}] $var
   423    607   } {0 0}
   424         -test string-6.37 {string is double, false on int overflow} -setup {
          608  +test string-6.37.$noComp {string is double, false on int overflow} -setup {
   425    609       set var priorValue
   426    610   } -body {
   427    611       # Make it the largest int recognizable, with one more digit for overflow
   428    612       # Since bignums arrived in Tcl 8.5, the sense of this test changed.
   429    613       # Now integer values that exceed native limits become bignums, and
   430    614       # bignums can convert to doubles without error.
   431         -    list [string is double -fail var [largest_int]0] $var
          615  +    list [run {string is double -fail var [largest_int]0}] $var
   432    616   } -result {1 priorValue}
   433    617   # string-6.38 removed, underflow on input is no longer an error.
   434         -test string-6.39 {string is double, false} {
          618  +test string-6.39.$noComp {string is double, false} {
   435    619       # This test is non-portable because IRIX thinks
   436    620       # that .e1 is a valid double - this is really a bug
   437    621       # on IRIX as .e1 should NOT be a valid double
   438    622       #
   439    623       # Portable now. Tcl 8.5 does its own double parsing.
   440    624   
   441         -    list [string is double -fail var .e1] $var
          625  +    list [run {string is double -fail var .e1}] $var
   442    626   } {0 0}
   443         -test string-6.40 {string is false, true} {
   444         -    string is false false
          627  +test string-6.40.$noComp {string is false, true} {
          628  +    run {string is false false}
   445    629   } 1
   446         -test string-6.41 {string is false, true} {
   447         -    string is false FaLsE
          630  +test string-6.41.$noComp {string is false, true} {
          631  +    run {string is false FaLsE}
   448    632   } 1
   449         -test string-6.42 {string is false, true} {
   450         -    string is false N
          633  +test string-6.42.$noComp {string is false, true} {
          634  +    run {string is false N}
   451    635   } 1
   452         -test string-6.43 {string is false, true} {
   453         -    string is false 0
          636  +test string-6.43.$noComp {string is false, true} {
          637  +    run {string is false 0}
   454    638   } 1
   455         -test string-6.44 {string is false, true} {
   456         -    string is false off
          639  +test string-6.44.$noComp {string is false, true} {
          640  +    run {string is false off}
   457    641   } 1
   458         -test string-6.45 {string is false, false} {
   459         -    list [string is false -fail var abc] $var
          642  +test string-6.45.$noComp {string is false, false} {
          643  +    list [run {string is false -fail var abc}] $var
   460    644   } {0 0}
   461         -test string-6.46 {string is false, false} {
          645  +test string-6.46.$noComp {string is false, false} {
   462    646       catch {unset var}
   463         -    list [string is false -fail var Y] $var
          647  +    list [run {string is false -fail var Y}] $var
   464    648   } {0 0}
   465         -test string-6.47 {string is false, false} {
          649  +test string-6.47.$noComp {string is false, false} {
   466    650       catch {unset var}
   467         -    list [string is false -fail var offensive] $var
          651  +    list [run {string is false -fail var offensive}] $var
   468    652   } {0 0}
   469         -test string-6.48 {string is integer, true} {
   470         -    string is integer +1234567890
   471         -} 1
   472         -test string-6.49 {string is integer, true on type} {
   473         -    string is integer [expr int(50.0)]
   474         -} 1
   475         -test string-6.50 {string is integer, true} {
   476         -    string is integer [list -10]
   477         -} 1
   478         -test string-6.51 {string is integer, true as hex} {
   479         -    string is integer 0xabcdef
   480         -} 1
   481         -test string-6.52 {string is integer, true as octal} {
   482         -    string is integer 012345
   483         -} 1
   484         -test string-6.53 {string is integer, true with whitespace} {
   485         -    string is integer "  \n1234\v"
   486         -} 1
   487         -test string-6.54 {string is integer, false} {
   488         -    list [string is integer -fail var 123abc] $var
          653  +test string-6.48.$noComp {string is integer, true} {
          654  +    run {string is integer +1234567890}
          655  +} 1
          656  +test string-6.49.$noComp {string is integer, true on type} {
          657  +    run {string is integer [expr int(50.0)]}
          658  +} 1
          659  +test string-6.50.$noComp {string is integer, true} {
          660  +    run {string is integer [list -10]}
          661  +} 1
          662  +test string-6.51.$noComp {string is integer, true as hex} {
          663  +    run {string is integer 0xabcdef}
          664  +} 1
          665  +test string-6.52.$noComp {string is integer, true as octal} {
          666  +    run {string is integer 012345}
          667  +} 1
          668  +test string-6.53.$noComp {string is integer, true with whitespace} {
          669  +    run {string is integer "  \n1234\v"}
          670  +} 1
          671  +test string-6.54.$noComp {string is integer, false} {
          672  +    list [run {string is integer -fail var 123abc}] $var
   489    673   } {0 3}
   490         -test string-6.55 {string is integer, false on overflow} {
   491         -    list [string is integer -fail var +[largest_int]0] $var
          674  +test string-6.55.$noComp {string is integer, false on overflow} {
          675  +    list [run {string is integer -fail var +[largest_int]0}] $var
   492    676   } {0 -1}
   493         -test string-6.56 {string is integer, false} {
   494         -    list [string is integer -fail var [expr double(1)]] $var
          677  +test string-6.56.$noComp {string is integer, false} {
          678  +    list [run {string is integer -fail var [expr double(1)]}] $var
   495    679   } {0 1}
   496         -test string-6.57 {string is integer, false} {
   497         -    list [string is integer -fail var "    "] $var
          680  +test string-6.57.$noComp {string is integer, false} {
          681  +    list [run {string is integer -fail var "    "}] $var
   498    682   } {0 0}
   499         -test string-6.58 {string is integer, false on bad octal} {
   500         -    list [string is integer -fail var 0o36963] $var
          683  +test string-6.58.$noComp {string is integer, false on bad octal} {
          684  +    list [run {string is integer -fail var 0o36963}] $var
   501    685   } {0 4}
   502         -test string-6.58.1 {string is integer, false on bad octal} {
   503         -    list [string is integer -fail var 0o36963] $var
          686  +test string-6.58.1.$noComp {string is integer, false on bad octal} {
          687  +    list [run {string is integer -fail var 0o36963}] $var
   504    688   } {0 4}
   505         -test string-6.59 {string is integer, false on bad hex} {
   506         -    list [string is integer -fail var 0X345XYZ] $var
          689  +test string-6.59.$noComp {string is integer, false on bad hex} {
          690  +    list [run {string is integer -fail var 0X345XYZ}] $var
   507    691   } {0 5}
   508         -test string-6.60 {string is lower, true} {
   509         -    string is lower abc
          692  +test string-6.60.$noComp {string is lower, true} {
          693  +    run {string is lower abc}
   510    694   } 1
   511         -test string-6.61 {string is lower, unicode true} {
   512         -    string is lower abc\u00fcue
          695  +test string-6.61.$noComp {string is lower, unicode true} {
          696  +    run {string is lower abc\u00fcue}
   513    697   } 1
   514         -test string-6.62 {string is lower, false} {
   515         -    list [string is lower -fail var aBc] $var
          698  +test string-6.62.$noComp {string is lower, false} {
          699  +    list [run {string is lower -fail var aBc}] $var
   516    700   } {0 1}
   517         -test string-6.63 {string is lower, false} {
   518         -    list [string is lower -fail var abc1] $var
          701  +test string-6.63.$noComp {string is lower, false} {
          702  +    list [run {string is lower -fail var abc1}] $var
   519    703   } {0 3}
   520         -test string-6.64 {string is lower, unicode false} {
   521         -    list [string is lower -fail var ab\u00dcUE] $var
          704  +test string-6.64.$noComp {string is lower, unicode false} {
          705  +    list [run {string is lower -fail var ab\u00dcUE}] $var
   522    706   } {0 2}
   523         -test string-6.65 {string is space, true} {
   524         -    string is space " \t\n\v\f"
          707  +test string-6.65.$noComp {string is space, true} {
          708  +    run {string is space " \t\n\v\f"}
   525    709   } 1
   526         -test string-6.66 {string is space, false} {
   527         -    list [string is space -fail var " \t\n\v1\f"] $var
          710  +test string-6.66.$noComp {string is space, false} {
          711  +    list [run {string is space -fail var " \t\n\v1\f"}] $var
   528    712   } {0 4}
   529         -test string-6.67 {string is true, true} {
   530         -    string is true true
          713  +test string-6.67.$noComp {string is true, true} {
          714  +    run {string is true true}
   531    715   } 1
   532         -test string-6.68 {string is true, true} {
   533         -    string is true TrU
          716  +test string-6.68.$noComp {string is true, true} {
          717  +    run {string is true TrU}
   534    718   } 1
   535         -test string-6.69 {string is true, true} {
   536         -    string is true ye
          719  +test string-6.69.$noComp {string is true, true} {
          720  +    run {string is true ye}
   537    721   } 1
   538         -test string-6.70 {string is true, true} {
   539         -    string is true 1
          722  +test string-6.70.$noComp {string is true, true} {
          723  +    run {string is true 1}
   540    724   } 1
   541         -test string-6.71 {string is true, true} {
   542         -    string is true on
          725  +test string-6.71.$noComp {string is true, true} {
          726  +    run {string is true on}
   543    727   } 1
   544         -test string-6.72 {string is true, false} {
   545         -    list [string is true -fail var onto] $var
          728  +test string-6.72.$noComp {string is true, false} {
          729  +    list [run {string is true -fail var onto}] $var
          730  +} {0 0}
          731  +test string-6.73.$noComp {string is true, false} {
          732  +    catch {unset var}
          733  +    list [run {string is true -fail var 25}] $var
   546    734   } {0 0}
   547         -test string-6.73 {string is true, false} {
          735  +test string-6.74.$noComp {string is true, false} {
   548    736       catch {unset var}
   549         -    list [string is true -fail var 25] $var
          737  +    list [run {string is true -fail var no}] $var
   550    738   } {0 0}
   551         -test string-6.74 {string is true, false} {
   552         -    catch {unset var}
   553         -    list [string is true -fail var no] $var
   554         -} {0 0}
   555         -test string-6.75 {string is upper, true} {
   556         -    string is upper ABC
          739  +test string-6.75.$noComp {string is upper, true} {
          740  +    run {string is upper ABC}
   557    741   } 1
   558         -test string-6.76 {string is upper, unicode true} {
   559         -    string is upper ABC\u00dcUE
          742  +test string-6.76.$noComp {string is upper, unicode true} {
          743  +    run {string is upper ABC\u00dcUE}
   560    744   } 1
   561         -test string-6.77 {string is upper, false} {
   562         -    list [string is upper -fail var AbC] $var
          745  +test string-6.77.$noComp {string is upper, false} {
          746  +    list [run {string is upper -fail var AbC}] $var
   563    747   } {0 1}
   564         -test string-6.78 {string is upper, false} {
   565         -    list [string is upper -fail var AB2C] $var
          748  +test string-6.78.$noComp {string is upper, false} {
          749  +    list [run {string is upper -fail var AB2C}] $var
   566    750   } {0 2}
   567         -test string-6.79 {string is upper, unicode false} {
   568         -    list [string is upper -fail var ABC\u00fcue] $var
          751  +test string-6.79.$noComp {string is upper, unicode false} {
          752  +    list [run {string is upper -fail var ABC\u00fcue}] $var
   569    753   } {0 3}
   570         -test string-6.80 {string is wordchar, true} {
   571         -    string is wordchar abc_123
          754  +test string-6.80.$noComp {string is wordchar, true} {
          755  +    run {string is wordchar abc_123}
   572    756   } 1
   573         -test string-6.81 {string is wordchar, unicode true} {
   574         -    string is wordchar abc\u00fcab\u00dcAB\u5001
          757  +test string-6.81.$noComp {string is wordchar, unicode true} {
          758  +    run {string is wordchar abc\u00fcab\u00dcAB\u5001}
   575    759   } 1
   576         -test string-6.82 {string is wordchar, false} {
   577         -    list [string is wordchar -fail var abcd.ef] $var
          760  +test string-6.82.$noComp {string is wordchar, false} {
          761  +    list [run {string is wordchar -fail var abcd.ef}] $var
   578    762   } {0 4}
   579         -test string-6.83 {string is wordchar, unicode false} {
   580         -    list [string is wordchar -fail var abc\u0080def] $var
          763  +test string-6.83.$noComp {string is wordchar, unicode false} {
          764  +    list [run {string is wordchar -fail var abc\u0080def}] $var
   581    765   } {0 3}
   582         -test string-6.84 {string is control} {
          766  +test string-6.84.$noComp {string is control} {
   583    767       ## Control chars are in the ranges
   584    768       ## 00..1F && 7F..9F
   585         -    list [string is control -fail var \x00\x01\x10\x1F\x7F\x80\x9F\x60] $var
          769  +    list [run {string is control -fail var \x00\x01\x10\x1F\x7F\x80\x9F\x60}] $var
   586    770   } {0 7}
   587         -test string-6.85 {string is control} {
   588         -    string is control \u0100
          771  +test string-6.85.$noComp {string is control} {
          772  +    run {string is control \u0100}
   589    773   } 0
   590         -test string-6.86 {string is graph} {
          774  +test string-6.86.$noComp {string is graph} {
   591    775       ## graph is any print char, except space
   592         -    list [string is gra -fail var "[email protected]#\$\u0100\UE0100\UE01EF "] $var
          776  +    list [run {string is gra -fail var "[email protected]#\$\u0100\UE0100\UE01EF "}] $var
   593    777   } {0 14}
   594         -test string-6.87 {string is print} {
          778  +test string-6.87.$noComp {string is print} {
   595    779       ## basically any printable char
   596         -    list [string is print -fail var "[email protected]#\$\u0100 \UE0100\UE01EF\u0010"] $var
          780  +    list [run {string is print -fail var "[email protected]#\$\u0100 \UE0100\UE01EF\u0010"}] $var
   597    781   } {0 15}
   598         -test string-6.88 {string is punct} {
          782  +test string-6.88.$noComp {string is punct} {
   599    783       ## any graph char that isn't alnum
   600         -    list [string is punct -fail var "[email protected]#\u00beq0"] $var
          784  +    list [run {string is punct -fail var "[email protected]#\u00beq0"}] $var
   601    785   } {0 4}
   602         -test string-6.89 {string is xdigit} {
   603         -    list [string is xdigit -fail var 0123456789\u0061bcdefABCDEFg] $var
          786  +test string-6.89.$noComp {string is xdigit} {
          787  +    list [run {string is xdigit -fail var 0123456789\u0061bcdefABCDEFg}] $var
   604    788   } {0 22}
   605    789   
   606         -test string-6.90 {string is integer, bad integers} {
          790  +test string-6.90.$noComp {string is integer, bad integers} {
          791  +    # SF bug #634856
          792  +    set result ""
          793  +    set numbers [list 1 +1 ++1 +-1 -+1 -1 --1 "- +1"]
          794  +    foreach num $numbers {
          795  +	lappend result [run {string is int -strict $num}]
          796  +    }
          797  +    return $result
          798  +} {1 1 0 0 0 1 0 0}
          799  +test string-6.91.$noComp {string is double, bad doubles} {
          800  +    set result ""
          801  +    set numbers [list 1.0 +1.0 ++1.0 +-1.0 -+1.0 -1.0 --1.0 "- +1.0"]
          802  +    foreach num $numbers {
          803  +	lappend result [run {string is double -strict $num}]
          804  +    }
          805  +    return $result
          806  +} {1 1 0 0 0 1 0 0}
          807  +test string-6.92.$noComp {string is integer, 32-bit overflow} {
          808  +    # Bug 718878
          809  +    set x 0x100000000
          810  +    list [run {string is integer -failindex var $x}] $var
          811  +} {0 -1}
          812  +test string-6.93.$noComp {string is integer, 32-bit overflow} {
          813  +    # Bug 718878
          814  +    set x 0x100000000
          815  +    append x ""
          816  +    list [run {string is integer -failindex var $x}] $var
          817  +} {0 -1}
          818  +test string-6.94.$noComp {string is integer, 32-bit overflow} {
          819  +    # Bug 718878
          820  +    set x 0x100000000
          821  +    list [run {string is integer -failindex var [expr {$x}]}] $var
          822  +} {0 -1}
          823  +test string-6.95.$noComp {string is wideinteger, true} {
          824  +    run {string is wideinteger +1234567890}
          825  +} 1
          826  +test string-6.96.$noComp {string is wideinteger, true on type} {
          827  +    run {string is wideinteger [expr wide(50.0)]}
          828  +} 1
          829  +test string-6.97.$noComp {string is wideinteger, true} {
          830  +    run {string is wideinteger [list -10]}
          831  +} 1
          832  +test string-6.98.$noComp {string is wideinteger, true as hex} {
          833  +    run {string is wideinteger 0xabcdef}
          834  +} 1
          835  +test string-6.99.$noComp {string is wideinteger, true as octal} {
          836  +    run {string is wideinteger 0123456}
          837  +} 1
          838  +test string-6.100.$noComp {string is wideinteger, true with whitespace} {
          839  +    run {string is wideinteger "  \n1234\v"}
          840  +} 1
          841  +test string-6.101.$noComp {string is wideinteger, false} {
          842  +    list [run {string is wideinteger -fail var 123abc}] $var
          843  +} {0 3}
          844  +test string-6.102.$noComp {string is wideinteger, false on overflow} {
          845  +    list [run {string is wideinteger -fail var +[largest_int]0}] $var
          846  +} {0 -1}
          847  +test string-6.103.$noComp {string is wideinteger, false} {
          848  +    list [run {string is wideinteger -fail var [expr double(1)]}] $var
          849  +} {0 1}
          850  +test string-6.104.$noComp {string is wideinteger, false} {
          851  +    list [run {string is wideinteger -fail var "    "}] $var
          852  +} {0 0}
          853  +test string-6.105.$noComp {string is wideinteger, false on bad octal} {
          854  +    list [run {string is wideinteger -fail var 0o36963}] $var
          855  +} {0 4}
          856  +test string-6.105.1.$noComp {string is wideinteger, false on bad octal} {
          857  +    list [run {string is wideinteger -fail var 0o36963}] $var
          858  +} {0 4}
          859  +test string-6.106.$noComp {string is wideinteger, false on bad hex} {
          860  +    list [run {string is wideinteger -fail var 0X345XYZ}] $var
          861  +} {0 5}
          862  +test string-6.107.$noComp {string is integer, bad integers} {
          863  +    # SF bug #634856
          864  +    set result ""
          865  +    set numbers [list 1 +1 ++1 +-1 -+1 -1 --1 "- +1"]
          866  +    foreach num $numbers {
          867  +	lappend result [run {string is wideinteger -strict $num}]
          868  +    }
          869  +    return $result
          870  +} {1 1 0 0 0 1 0 0}
          871  +test string-6.108.$noComp {string is double, Bug 1382287} {
          872  +    set x 2turtledoves
          873  +    run {string is double $x}
          874  +    run {string is double $x}
          875  +} 0
          876  +test string-6.109.$noComp {string is double, Bug 1360532} {
          877  +    run {string is double 1\u00a0}
          878  +} 0
          879  +test string-6.110.$noComp {string is entier, true} {
          880  +    run {string is entier +1234567890}
          881  +} 1
          882  +test string-6.111.$noComp {string is entier, true on type} {
          883  +    run {string is entier [expr wide(50.0)]}
          884  +} 1
          885  +test string-6.112.$noComp {string is entier, true} {
          886  +    run {string is entier [list -10]}
          887  +} 1
          888  +test string-6.113.$noComp {string is entier, true as hex} {
          889  +    run {string is entier 0xabcdef}
          890  +} 1
          891  +test string-6.114.$noComp {string is entier, true as octal} {
          892  +    run {string is entier 0123456}
          893  +} 1
          894  +test string-6.115.$noComp {string is entier, true with whitespace} {
          895  +    run {string is entier "  \n1234\v"}
          896  +} 1
          897  +test string-6.116.$noComp {string is entier, false} {
          898  +    list [run {string is entier -fail var 123abc}] $var
          899  +} {0 3}
          900  +test string-6.117.$noComp {string is entier, false} {
          901  +    list [run {string is entier -fail var 123123123123123123123123123123123123123123123123123123123123123123123123123123123123abc}] $var
          902  +} {0 84}
          903  +test string-6.118.$noComp {string is entier, false} {
          904  +    list [run {string is entier -fail var [expr double(1)]}] $var
          905  +} {0 1}
          906  +test string-6.119.$noComp {string is entier, false} {
          907  +    list [run {string is entier -fail var "    "}] $var
          908  +} {0 0}
          909  +test string-6.120.$noComp {string is entier, false on bad octal} {
          910  +    list [run {string is entier -fail var 0o36963}] $var
          911  +} {0 4}
          912  +test string-6.121.1.$noComp {string is entier, false on bad octal} {
          913  +    list [run {string is entier -fail var 0o36963}] $var
          914  +} {0 4}
          915  +test string-6.122.$noComp {string is entier, false on bad hex} {
          916  +    list [run {string is entier -fail var 0X345XYZ}] $var
          917  +} {0 5}
          918  +test string-6.123.$noComp {string is entier, bad integers} {
   607    919       # SF bug #634856
   608    920       set result ""
   609    921       set numbers [list 1 +1 ++1 +-1 -+1 -1 --1 "- +1"]
   610    922       foreach num $numbers {
   611         -	lappend result [string is int -strict $num]
          923  +	lappend result [run {string is entier -strict $num}]
   612    924       }
   613    925       return $result
   614    926   } {1 1 0 0 0 1 0 0}
   615         -test string-6.91 {string is double, bad doubles} {
   616         -    set result ""
   617         -    set numbers [list 1.0 +1.0 ++1.0 +-1.0 -+1.0 -1.0 --1.0 "- +1.0"]
   618         -    foreach num $numbers {
   619         -	lappend result [string is double -strict $num]
   620         -    }
   621         -    return $result
   622         -} {1 1 0 0 0 1 0 0}
   623         -test string-6.92 {string is integer, 32-bit overflow} {
   624         -    # Bug 718878
   625         -    set x 0x100000000
   626         -    list [string is integer -failindex var $x] $var
   627         -} {0 -1}
   628         -test string-6.93 {string is integer, 32-bit overflow} {
   629         -    # Bug 718878
   630         -    set x 0x100000000
   631         -    append x ""
   632         -    list [string is integer -failindex var $x] $var
   633         -} {0 -1}
   634         -test string-6.94 {string is integer, 32-bit overflow} {
   635         -    # Bug 718878
   636         -    set x 0x100000000
   637         -    list [string is integer -failindex var [expr {$x}]] $var
   638         -} {0 -1}
   639         -test string-6.95 {string is wideinteger, true} {
   640         -    string is wideinteger +1234567890
   641         -} 1
   642         -test string-6.96 {string is wideinteger, true on type} {
   643         -    string is wideinteger [expr wide(50.0)]
   644         -} 1
   645         -test string-6.97 {string is wideinteger, true} {
   646         -    string is wideinteger [list -10]
   647         -} 1
   648         -test string-6.98 {string is wideinteger, true as hex} {
   649         -    string is wideinteger 0xabcdef
   650         -} 1
   651         -test string-6.99 {string is wideinteger, true as octal} {
   652         -    string is wideinteger 0123456
   653         -} 1
   654         -test string-6.100 {string is wideinteger, true with whitespace} {
   655         -    string is wideinteger "  \n1234\v"
   656         -} 1
   657         -test string-6.101 {string is wideinteger, false} {
   658         -    list [string is wideinteger -fail var 123abc] $var
   659         -} {0 3}
   660         -test string-6.102 {string is wideinteger, false on overflow} {
   661         -    list [string is wideinteger -fail var +[largest_int]0] $var
   662         -} {0 -1}
   663         -test string-6.103 {string is wideinteger, false} {
   664         -    list [string is wideinteger -fail var [expr double(1)]] $var
   665         -} {0 1}
   666         -test string-6.104 {string is wideinteger, false} {
   667         -    list [string is wideinteger -fail var "    "] $var
   668         -} {0 0}
   669         -test string-6.105 {string is wideinteger, false on bad octal} {
   670         -    list [string is wideinteger -fail var 0o36963] $var
   671         -} {0 4}
   672         -test string-6.105.1 {string is wideinteger, false on bad octal} {
   673         -    list [string is wideinteger -fail var 0o36963] $var
   674         -} {0 4}
   675         -test string-6.106 {string is wideinteger, false on bad hex} {
   676         -    list [string is wideinteger -fail var 0X345XYZ] $var
   677         -} {0 5}
   678         -test string-6.107 {string is integer, bad integers} {
   679         -    # SF bug #634856
   680         -    set result ""
   681         -    set numbers [list 1 +1 ++1 +-1 -+1 -1 --1 "- +1"]
   682         -    foreach num $numbers {
   683         -	lappend result [string is wideinteger -strict $num]
   684         -    }
   685         -    return $result
   686         -} {1 1 0 0 0 1 0 0}
   687         -test string-6.108 {string is double, Bug 1382287} {
   688         -    set x 2turtledoves
   689         -    string is double $x
   690         -    string is double $x
   691         -} 0
   692         -test string-6.109 {string is double, Bug 1360532} {
   693         -    string is double 1\u00a0
   694         -} 0
   695         -test string-6.110 {string is entier, true} {
   696         -    string is entier +1234567890
   697         -} 1
   698         -test string-6.111 {string is entier, true on type} {
   699         -    string is entier [expr wide(50.0)]
   700         -} 1
   701         -test string-6.112 {string is entier, true} {
   702         -    string is entier [list -10]
   703         -} 1
   704         -test string-6.113 {string is entier, true as hex} {
   705         -    string is entier 0xabcdef
   706         -} 1
   707         -test string-6.114 {string is entier, true as octal} {
   708         -    string is entier 0123456
   709         -} 1
   710         -test string-6.115 {string is entier, true with whitespace} {
   711         -    string is entier "  \n1234\v"
   712         -} 1
   713         -test string-6.116 {string is entier, false} {
   714         -    list [string is entier -fail var 123abc] $var
   715         -} {0 3}
   716         -test string-6.117 {string is entier, false} {
   717         -    list [string is entier -fail var 123123123123123123123123123123123123123123123123123123123123123123123123123123123123abc] $var
   718         -} {0 84}
   719         -test string-6.118 {string is entier, false} {
   720         -    list [string is entier -fail var [expr double(1)]] $var
   721         -} {0 1}
   722         -test string-6.119 {string is entier, false} {
   723         -    list [string is entier -fail var "    "] $var
   724         -} {0 0}
   725         -test string-6.120 {string is entier, false on bad octal} {
   726         -    list [string is entier -fail var 0o36963] $var
   727         -} {0 4}
   728         -test string-6.121.1 {string is entier, false on bad octal} {
   729         -    list [string is entier -fail var 0o36963] $var
   730         -} {0 4}
   731         -test string-6.122 {string is entier, false on bad hex} {
   732         -    list [string is entier -fail var 0X345XYZ] $var
   733         -} {0 5}
   734         -test string-6.123 {string is entier, bad integers} {
   735         -    # SF bug #634856
   736         -    set result ""
   737         -    set numbers [list 1 +1 ++1 +-1 -+1 -1 --1 "- +1"]
   738         -    foreach num $numbers {
   739         -	lappend result [string is entier -strict $num]
   740         -    }
   741         -    return $result
   742         -} {1 1 0 0 0 1 0 0}
   743         -test string-6.124 {string is entier, true} {
   744         -    string is entier +1234567890123456789012345678901234567890
   745         -} 1
   746         -test string-6.125 {string is entier, true} {
   747         -    string is entier [list -10000000000000000000000000000000000000000000000000000000000000000000000000000000000000]
   748         -} 1
   749         -test string-6.126 {string is entier, true as hex} {
   750         -    string is entier 0xabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef
   751         -} 1
   752         -test string-6.127 {string is entier, true as octal} {
   753         -    string is entier 0123456112341234561234565623456123456123456123456123456123456123456123456123456123456
   754         -} 1
   755         -test string-6.128 {string is entier, true with whitespace} {
   756         -    string is entier "  \n12340000000000000000000000000000000000000000000000000000000000000000000000000000000000000\v"
   757         -} 1
   758         -test string-6.129 {string is entier, false on bad octal} {
   759         -    list [string is entier -fail var 0o1234561123412345612345656234561234561234561234561234561234561234561234561234561234536963] $var
          927  +test string-6.124.$noComp {string is entier, true} {
          928  +    run {string is entier +1234567890123456789012345678901234567890}
          929  +} 1
          930  +test string-6.125.$noComp {string is entier, true} {
          931  +    run {string is entier [list -10000000000000000000000000000000000000000000000000000000000000000000000000000000000000]}
          932  +} 1
          933  +test string-6.126.$noComp {string is entier, true as hex} {
          934  +    run {string is entier 0xabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef}
          935  +} 1
          936  +test string-6.127.$noComp {string is entier, true as octal} {
          937  +    run {string is entier 0123456112341234561234565623456123456123456123456123456123456123456123456123456123456}
          938  +} 1
          939  +test string-6.128.$noComp {string is entier, true with whitespace} {
          940  +    run {string is entier "  \n12340000000000000000000000000000000000000000000000000000000000000000000000000000000000000\v"}
          941  +} 1
          942  +test string-6.129.$noComp {string is entier, false on bad octal} {
          943  +    list [run {string is entier -fail var 0o1234561123412345612345656234561234561234561234561234561234561234561234561234561234536963}] $var
          944  +} {0 87}
          945  +test string-6.130.1.$noComp {string is entier, false on bad octal} {
          946  +    list [run {string is entier -fail var 0o1234561123412345612345656234561234561234561234561234561234561234561234561234561234536963}] $var
   760    947   } {0 87}
   761         -test string-6.130.1 {string is entier, false on bad octal} {
   762         -    list [string is entier -fail var 0o1234561123412345612345656234561234561234561234561234561234561234561234561234561234536963] $var
   763         -} {0 87}
   764         -test string-6.131 {string is entier, false on bad hex} {
   765         -    list [string is entier -fail var 0X12345611234123456123456562345612345612345612345612345612345612345612345612345612345345XYZ] $var
          948  +test string-6.131.$noComp {string is entier, false on bad hex} {
          949  +    list [run {string is entier -fail var 0X12345611234123456123456562345612345612345612345612345612345612345612345612345612345345XYZ}] $var
   766    950   } {0 88}
   767    951   
   768    952   catch {rename largest_int {}}
   769    953   
   770         -test string-7.1 {string last, too few args} {
   771         -    list [catch {string last a} msg] $msg
          954  +test string-7.1.$noComp {string last, too few args} {
          955  +    list [catch {run {string last a}} msg] $msg
   772    956   } {1 {wrong # args: should be "string last needleString haystackString ?lastIndex?"}}
   773         -test string-7.2 {string last, bad args} {
   774         -    list [catch {string last a b c} msg] $msg
          957  +test string-7.2.$noComp {string last, bad args} {
          958  +    list [catch {run {string last a b c}} msg] $msg
   775    959   } {1 {bad index "c": must be integer?[+-]integer? or end?[+-]integer?}}
   776         -test string-7.3 {string last, too many args} {
   777         -    list [catch {string last a b c d} msg] $msg
          960  +test string-7.3.$noComp {string last, too many args} {
          961  +    list [catch {run {string last a b c d}} msg] $msg
   778    962   } {1 {wrong # args: should be "string last needleString haystackString ?lastIndex?"}}
   779         -test string-7.4 {string last} {
   780         -    string la xxx xxxx123xx345x678
          963  +test string-7.4.$noComp {string last} {
          964  +    run {string la xxx xxxx123xx345x678}
   781    965   } 1
   782         -test string-7.5 {string last} {
   783         -    string last xx xxxx123xx345x678
          966  +test string-7.5.$noComp {string last} {
          967  +    run {string last xx xxxx123xx345x678}
   784    968   } 7
   785         -test string-7.6 {string last} {
   786         -    string las x xxxx123xx345x678
          969  +test string-7.6.$noComp {string last} {
          970  +    run {string las x xxxx123xx345x678}
   787    971   } 12
   788         -test string-7.7 {string last, unicode} {
   789         -    string las x xxxx12\u7266xx345x678
          972  +test string-7.7.$noComp {string last, unicode} {
          973  +    run {string las x xxxx12\u7266xx345x678}
   790    974   } 12
   791         -test string-7.8 {string last, unicode} {
   792         -    string las \u7266 xxxx12\u7266xx345x678
          975  +test string-7.8.$noComp {string last, unicode} {
          976  +    run {string las \u7266 xxxx12\u7266xx345x678}
   793    977   } 6
   794         -test string-7.9 {string last, stop index} {
   795         -    string las \u7266 xxxx12\u7266xx345x678
          978  +test string-7.9.$noComp {string last, stop index} {
          979  +    run {string las \u7266 xxxx12\u7266xx345x678}
   796    980   } 6
   797         -test string-7.10 {string last, unicode} {
   798         -    string las \u7266 xxxx12\u7266xx345x678
          981  +test string-7.10.$noComp {string last, unicode} {
          982  +    run {string las \u7266 xxxx12\u7266xx345x678}
   799    983   } 6
   800         -test string-7.11 {string last, start index} {
   801         -    string last \u7266 abc\u7266x 3
          984  +test string-7.11.$noComp {string last, start index} {
          985  +    run {string last \u7266 abc\u7266x 3}
   802    986   } 3
   803         -test string-7.12 {string last, start index} {
   804         -    string last \u7266 abc\u7266x 2
          987  +test string-7.12.$noComp {string last, start index} {
          988  +    run {string last \u7266 abc\u7266x 2}
   805    989   } -1
   806         -test string-7.13 {string last, start index} {
          990  +test string-7.13.$noComp {string last, start index} {
   807    991       ## Constrain to last 'a' should work
   808         -    string last ba badbad end-1
          992  +    run {string last ba badbad end-1}
   809    993   } 3
   810         -test string-7.14 {string last, start index} {
          994  +test string-7.14.$noComp {string last, start index} {
   811    995       ## Constrain to last 'b' should skip last 'ba'
   812         -    string last ba badbad end-2
          996  +    run {string last ba badbad end-2}
   813    997   } 0
   814         -test string-7.15 {string last, start index} {
   815         -    string last \334a \334ad\334ad 0
          998  +test string-7.15.$noComp {string last, start index} {
          999  +    run {string last \334a \334ad\334ad 0}
   816   1000   } -1
   817         -test string-7.16 {string last, start index} {
   818         -    string last \334a \334ad\334ad end-1
         1001  +test string-7.16.$noComp {string last, start index} {
         1002  +    run {string last \334a \334ad\334ad end-1}
   819   1003   } 3
   820   1004   
   821         -test string-8.1 {string bytelength} {
   822         -    list [catch {string bytelength} msg] $msg
         1005  +test string-8.1.$noComp {string bytelength} {
         1006  +    list [catch {run {string bytelength}} msg] $msg
   823   1007   } {1 {wrong # args: should be "string bytelength string"}}
   824         -test string-8.2 {string bytelength} {
   825         -    list [catch {string bytelength a b} msg] $msg
         1008  +test string-8.2.$noComp {string bytelength} {
         1009  +    list [catch {run {string bytelength a b}} msg] $msg
   826   1010   } {1 {wrong # args: should be "string bytelength string"}}
   827         -test string-8.3 {string bytelength} {
   828         -    string bytelength "\u00c7"
         1011  +test string-8.3.$noComp {string bytelength} {
         1012  +    run {string bytelength "\u00c7"}
   829   1013   } 2
   830         -test string-8.4 {string bytelength} {
   831         -    string b ""
         1014  +test string-8.4.$noComp {string bytelength} {
         1015  +    run {string b ""}
   832   1016   } 0
   833   1017   
   834         -test string-9.1 {string length} {
   835         -    list [catch {string length} msg] $msg
         1018  +test string-9.1.$noComp {string length} {
         1019  +    list [catch {run {string length}} msg] $msg
   836   1020   } {1 {wrong # args: should be "string length string"}}
   837         -test string-9.2 {string length} {
   838         -    list [catch {string length a b} msg] $msg
         1021  +test string-9.2.$noComp {string length} {
         1022  +    list [catch {run {string length a b}} msg] $msg
   839   1023   } {1 {wrong # args: should be "string length string"}}
   840         -test string-9.3 {string length} {
   841         -    string length "a little string"
         1024  +test string-9.3.$noComp {string length} {
         1025  +    run {string length "a little string"}
   842   1026   } 15
   843         -test string-9.4 {string length} {
   844         -    string le ""
         1027  +test string-9.4.$noComp {string length} {
         1028  +    run {string le ""}
   845   1029   } 0
   846         -test string-9.5 {string length, unicode} {
   847         -    string le "abcd\u7266"
         1030  +test string-9.5.$noComp {string length, unicode} {
         1031  +    run {string le "abcd\u7266"}
         1032  +} 5
         1033  +test string-9.6.$noComp {string length, bytearray object} {
         1034  +    run {string length [binary format a5 foo]}
   848   1035   } 5
   849         -test string-9.6 {string length, bytearray object} {
   850         -    string length [binary format a5 foo]
   851         -} 5
   852         -test string-9.7 {string length, bytearray object} {
   853         -    string length [binary format I* {0x50515253 0x52}]
         1036  +test string-9.7.$noComp {string length, bytearray object} {
         1037  +    run {string length [binary format I* {0x50515253 0x52}]}
   854   1038   } 8
   855   1039   
   856         -test string-10.1 {string map, too few args} {
   857         -    list [catch {string map} msg] $msg
         1040  +test string-10.1.$noComp {string map, too few args} {
         1041  +    list [catch {run {string map}} msg] $msg
   858   1042   } {1 {wrong # args: should be "string map ?-nocase? charMap string"}}
   859         -test string-10.2 {string map, bad args} {
   860         -    list [catch {string map {a b} abba oops} msg] $msg
         1043  +test string-10.2.$noComp {string map, bad args} {
         1044  +    list [catch {run {string map {a b} abba oops}} msg] $msg
   861   1045   } {1 {bad option "a b": must be -nocase}}
   862         -test string-10.3 {string map, too many args} {
   863         -    list [catch {string map -nocase {a b} str1 str2} msg] $msg
         1046  +test string-10.3.$noComp {string map, too many args} {
         1047  +    list [catch {run {string map -nocase {a b} str1 str2}} msg] $msg
   864   1048   } {1 {wrong # args: should be "string map ?-nocase? charMap string"}}
   865         -test string-10.4 {string map} {
   866         -    string map {a b} abba
         1049  +test string-10.4.$noComp {string map} {
         1050  +    run {string map {a b} abba}
   867   1051   } {bbbb}
   868         -test string-10.5 {string map} {
   869         -    string map {a b} a
         1052  +test string-10.5.$noComp {string map} {
         1053  +    run {string map {a b} a}
   870   1054   } {b}
   871         -test string-10.6 {string map -nocase} {
   872         -    string map -nocase {a b} Abba
         1055  +test string-10.6.$noComp {string map -nocase} {
         1056  +    run {string map -nocase {a b} Abba}
   873   1057   } {bbbb}
   874         -test string-10.7 {string map} {
   875         -    string map {abc 321 ab * a A} aabcabaababcab
         1058  +test string-10.7.$noComp {string map} {
         1059  +    run {string map {abc 321 ab * a A} aabcabaababcab}
   876   1060   } {A321*A*321*}
   877         -test string-10.8 {string map -nocase} {
   878         -    string map -nocase {aBc 321 Ab * a A} aabcabaababcab
         1061  +test string-10.8.$noComp {string map -nocase} {
         1062  +    run {string map -nocase {aBc 321 Ab * a A} aabcabaababcab}
   879   1063   } {A321*A*321*}
   880         -test string-10.9 {string map -nocase} {
   881         -    string map -no {abc 321 Ab * a A} aAbCaBaAbAbcAb
         1064  +test string-10.9.$noComp {string map -nocase} {
         1065  +    run {string map -no {abc 321 Ab * a A} aAbCaBaAbAbcAb}
   882   1066   } {A321*A*321*}
   883         -test string-10.10 {string map} {
   884         -    list [catch {string map {a b c} abba} msg] $msg
         1067  +test string-10.10.$noComp {string map} {
         1068  +    list [catch {run {string map {a b c} abba}} msg] $msg
   885   1069   } {1 {char map list unbalanced}}
   886         -test string-10.11 {string map, nulls} {
   887         -    string map {\x00 NULL blah \x00nix} {qwerty}
         1070  +test string-10.11.$noComp {string map, nulls} {
         1071  +    run {string map {\x00 NULL blah \x00nix} {qwerty}}
   888   1072   } {qwerty}
   889         -test string-10.12 {string map, unicode} {
   890         -    string map [list \374 ue UE \334] "a\374ueUE\000EU"
         1073  +test string-10.12.$noComp {string map, unicode} {
         1074  +    run {string map [list \374 ue UE \334] "a\374ueUE\000EU"}
   891   1075   } aueue\334\0EU
   892         -test string-10.13 {string map, -nocase unicode} {
   893         -    string map -nocase [list \374 ue UE \334] "a\374ueUE\000EU"
         1076  +test string-10.13.$noComp {string map, -nocase unicode} {
         1077  +    run {string map -nocase [list \374 ue UE \334] "a\374ueUE\000EU"}
   894   1078   } aue\334\334\0EU
   895         -test string-10.14 {string map, -nocase null arguments} {
   896         -    string map -nocase {{} abc} foo
         1079  +test string-10.14.$noComp {string map, -nocase null arguments} {
         1080  +    run {string map -nocase {{} abc} foo}
   897   1081   } foo
   898         -test string-10.15 {string map, one pair case} {
   899         -    string map -nocase {abc 32} aAbCaBaAbAbcAb
         1082  +test string-10.15.$noComp {string map, one pair case} {
         1083  +    run {string map -nocase {abc 32} aAbCaBaAbAbcAb}
   900   1084   } {a32aBaAb32Ab}
   901         -test string-10.16 {string map, one pair case} {
   902         -    string map -nocase {ab 4321} aAbCaBaAbAbcAb
         1085  +test string-10.16.$noComp {string map, one pair case} {
         1086  +    run {string map -nocase {ab 4321} aAbCaBaAbAbcAb}
   903   1087   } {a4321C4321a43214321c4321}
   904         -test string-10.17 {string map, one pair case} {
   905         -    string map {Ab 4321} aAbCaBaAbAbcAb
         1088  +test string-10.17.$noComp {string map, one pair case} {
         1089  +    run {string map {Ab 4321} aAbCaBaAbAbcAb}
   906   1090   } {a4321CaBa43214321c4321}
   907         -test string-10.18 {string map, empty argument} {
   908         -    string map -nocase {{} abc} foo
         1091  +test string-10.18.$noComp {string map, empty argument} {
         1092  +    run {string map -nocase {{} abc} foo}
   909   1093   } foo
   910         -test string-10.19 {string map, empty arguments} {
   911         -    string map -nocase {{} abc f bar {} def} foo
         1094  +test string-10.19.$noComp {string map, empty arguments} {
         1095  +    run {string map -nocase {{} abc f bar {} def} foo}
   912   1096   } baroo
   913         -test string-10.20 {string map, dictionaries don't alter map ordering} {
         1097  +test string-10.20.$noComp {string map, dictionaries don't alter map ordering} {
   914   1098       set map {aa X a Y}
   915         -    list [string map [dict create aa X a Y] aaa] [string map $map aaa] [dict size $map] [string map $map aaa]
         1099  +    list [run {string map [dict create aa X a Y] aaa}] [run {string map $map aaa}] [dict size $map] [run {string map $map aaa}]
   916   1100   } {XY XY 2 XY}
   917         -test string-10.20.1 {string map, dictionaries don't alter map ordering} {
         1101  +test string-10.20.1.$noComp {string map, dictionaries don't alter map ordering} {
   918   1102       set map {a X b Y a Z}
   919         -    list [string map [dict create a X b Y a Z] aaa] [string map $map aaa] [dict size $map] [string map $map aaa]
         1103  +    list [run {string map [dict create a X b Y a Z] aaa}] [run {string map $map aaa}] [dict size $map] [run {string map $map aaa}]
   920   1104   } {ZZZ XXX 2 XXX}
   921         -test string-10.21 {string map, ABR checks} {
   922         -    string map {longstring foob} long
         1105  +test string-10.21.$noComp {string map, ABR checks} {
         1106  +    run {string map {longstring foob} long}
   923   1107   } long
   924         -test string-10.22 {string map, ABR checks} {
   925         -    string map {long foob} long
         1108  +test string-10.22.$noComp {string map, ABR checks} {
         1109  +    run {string map {long foob} long}
   926   1110   } foob
   927         -test string-10.23 {string map, ABR checks} {
   928         -    string map {lon foob} long
         1111  +test string-10.23.$noComp {string map, ABR checks} {
         1112  +    run {string map {lon foob} long}
   929   1113   } foobg
   930         -test string-10.24 {string map, ABR checks} {
   931         -    string map {lon foob} longlo
         1114  +test string-10.24.$noComp {string map, ABR checks} {
         1115  +    run {string map {lon foob} longlo}
   932   1116   } foobglo
   933         -test string-10.25 {string map, ABR checks} {
   934         -    string map {lon foob} longlon
         1117  +test string-10.25.$noComp {string map, ABR checks} {
         1118  +    run {string map {lon foob} longlon}
   935   1119   } foobgfoob
   936         -test string-10.26 {string map, ABR checks} {
   937         -    string map {longstring foob longstring bar} long
         1120  +test string-10.26.$noComp {string map, ABR checks} {
         1121  +    run {string map {longstring foob longstring bar} long}
   938   1122   } long
   939         -test string-10.27 {string map, ABR checks} {
   940         -    string map {long foob longstring bar} long
         1123  +test string-10.27.$noComp {string map, ABR checks} {
         1124  +    run {string map {long foob longstring bar} long}
   941   1125   } foob
   942         -test string-10.28 {string map, ABR checks} {
   943         -    string map {lon foob longstring bar} long
         1126  +test string-10.28.$noComp {string map, ABR checks} {
         1127  +    run {string map {lon foob longstring bar} long}
   944   1128   } foobg
   945         -test string-10.29 {string map, ABR checks} {
   946         -    string map {lon foob longstring bar} longlo
         1129  +test string-10.29.$noComp {string map, ABR checks} {
         1130  +    run {string map {lon foob longstring bar} longlo}
   947   1131   } foobglo
   948         -test string-10.30 {string map, ABR checks} {
   949         -    string map {lon foob longstring bar} longlon
         1132  +test string-10.30.$noComp {string map, ABR checks} {
         1133  +    run {string map {lon foob longstring bar} longlon}
   950   1134   } foobgfoob
   951         -test string-10.31 {string map, nasty sharing crash from [Bug 1018562]} {
         1135  +test string-10.31.$noComp {string map, nasty sharing crash from [Bug 1018562]} {
   952   1136       set a {a b}
   953         -    string map $a $a
         1137  +    run {string map $a $a}
   954   1138   } {b b}
   955   1139   
   956         -test string-11.1 {string match, too few args} {
   957         -    list [catch {string match a} msg] $msg
         1140  +test string-11.1.$noComp {string match, too few args} {
         1141  +    list [catch {run {string match a}} msg] $msg
   958   1142   } {1 {wrong # args: should be "string match ?-nocase? pattern string"}}
   959         -test string-11.2 {string match, too many args} {
   960         -    list [catch {string match a b c d} msg] $msg
         1143  +test string-11.2.$noComp {string match, too many args} {
         1144  +    list [catch {run {string match a b c d}} msg] $msg
   961   1145   } {1 {wrong # args: should be "string match ?-nocase? pattern string"}}
   962         -test string-11.3 {string match} {
   963         -    string match abc abc
   964         -} 1
   965         -test string-11.4 {string match} {
   966         -    string mat abc abd
   967         -} 0
   968         -test string-11.5 {string match} {
   969         -    string match ab*c abc
   970         -} 1
   971         -test string-11.6 {string match} {
   972         -    string match ab**c abc
   973         -} 1
   974         -test string-11.7 {string match} {
   975         -    string match ab* abcdef
   976         -} 1
   977         -test string-11.8 {string match} {
   978         -    string match *c abc
   979         -} 1
   980         -test string-11.9 {string match} {
   981         -    string match *3*6*9 0123456789
   982         -} 1
   983         -test string-11.9.1 {string match} {
   984         -    string match *3*6*89 0123456789
   985         -} 1
   986         -test string-11.9.2 {string match} {
   987         -    string match *3*456*89 0123456789
   988         -} 1
   989         -test string-11.9.3 {string match} {
   990         -    string match *3*6* 0123456789
   991         -} 1
   992         -test string-11.9.4 {string match} {
   993         -    string match *3*56* 0123456789
   994         -} 1
   995         -test string-11.9.5 {string match} {
   996         -    string match *3*456*** 0123456789
   997         -} 1
   998         -test string-11.9.6 {string match} {
   999         -    string match **3*456** 0123456789
  1000         -} 1
  1001         -test string-11.9.7 {string match} {
  1002         -    string match *3***456* 0123456789
  1003         -} 1
  1004         -test string-11.9.8 {string match} {
  1005         -    string match *3***\[456]* 0123456789
  1006         -} 1
  1007         -test string-11.9.9 {string match} {
  1008         -    string match *3***\[4-6]* 0123456789
  1009         -} 1
  1010         -test string-11.9.10 {string match} {
  1011         -    string match *3***\[4-6] 0123456789
  1012         -} 0
  1013         -test string-11.9.11 {string match} {
  1014         -    string match *3***\[4-6] 0123456
  1015         -} 1
  1016         -test string-11.10 {string match} {
  1017         -    string match *3*6*9 01234567890
  1018         -} 0
  1019         -test string-11.10.1 {string match} {
  1020         -    string match *3*6*89 01234567890
  1021         -} 0
  1022         -test string-11.10.2 {string match} {
  1023         -    string match *3*456*89 01234567890
  1024         -} 0
  1025         -test string-11.10.3 {string match} {
  1026         -    string match **3*456*89 01234567890
  1027         -} 0
  1028         -test string-11.10.4 {string match} {
  1029         -    string match *3*456***89 01234567890
  1030         -} 0
  1031         -test string-11.11 {string match} {
  1032         -    string match a?c abc
  1033         -} 1
  1034         -test string-11.12 {string match} {
  1035         -    string match a??c abc
  1036         -} 0
  1037         -test string-11.13 {string match} {
  1038         -    string match ?1??4???8? 0123456789
  1039         -} 1
  1040         -test string-11.14 {string match} {
  1041         -    string match {[abc]bc} abc
  1042         -} 1
  1043         -test string-11.15 {string match} {
  1044         -    string match {a[abc]c} abc
  1045         -} 1
  1046         -test string-11.16 {string match} {
  1047         -    string match {a[xyz]c} abc
  1048         -} 0
  1049         -test string-11.17 {string match} {
  1050         -    string match {12[2-7]45} 12345
  1051         -} 1
  1052         -test string-11.18 {string match} {
  1053         -    string match {12[ab2-4cd]45} 12345
  1054         -} 1
  1055         -test string-11.19 {string match} {
  1056         -    string match {12[ab2-4cd]45} 12b45
  1057         -} 1
  1058         -test string-11.20 {string match} {
  1059         -    string match {12[ab2-4cd]45} 12d45
  1060         -} 1
  1061         -test string-11.21 {string match} {
  1062         -    string match {12[ab2-4cd]45} 12145
  1063         -} 0
  1064         -test string-11.22 {string match} {
  1065         -    string match {12[ab2-4cd]45} 12545
  1066         -} 0
  1067         -test string-11.23 {string match} {
  1068         -    string match {a\*b} a*b
  1069         -} 1
  1070         -test string-11.24 {string match} {
  1071         -    string match {a\*b} ab
  1072         -} 0
  1073         -test string-11.25 {string match} {
  1074         -    string match {a\*\?\[\]\\\x} "a*?\[\]\\x"
  1075         -} 1
  1076         -test string-11.26 {string match} {
  1077         -    string match ** ""
  1078         -} 1
  1079         -test string-11.27 {string match} {
  1080         -    string match *. ""
  1081         -} 0
  1082         -test string-11.28 {string match} {
  1083         -    string match "" ""
  1084         -} 1
  1085         -test string-11.29 {string match} {
  1086         -    string match \[a a
  1087         -} 1
  1088         -test string-11.30 {string match, bad args} {
  1089         -    list [catch {string match - b c} msg] $msg
         1146  +test string-11.3.$noComp {string match} {
         1147  +    run {string match abc abc}
         1148  +} 1
         1149  +test string-11.4.$noComp {string match} {
         1150  +    run {string mat abc abd}
         1151  +} 0
         1152  +test string-11.5.$noComp {string match} {
         1153  +    run {string match ab*c abc}
         1154  +} 1
         1155  +test string-11.6.$noComp {string match} {
         1156  +    run {string match ab**c abc}
         1157  +} 1
         1158  +test string-11.7.$noComp {string match} {
         1159  +    run {string match ab* abcdef}
         1160  +} 1
         1161  +test string-11.8.$noComp {string match} {
         1162  +    run {string match *c abc}
         1163  +} 1
         1164  +test string-11.9.$noComp {string match} {
         1165  +    run {string match *3*6*9 0123456789}
         1166  +} 1
         1167  +test string-11.9.1.$noComp {string match} {
         1168  +    run {string match *3*6*89 0123456789}
         1169  +} 1
         1170  +test string-11.9.2.$noComp {string match} {
         1171  +    run {string match *3*456*89 0123456789}
         1172  +} 1
         1173  +test string-11.9.3.$noComp {string match} {
         1174  +    run {string match *3*6* 0123456789}
         1175  +} 1
         1176  +test string-11.9.4.$noComp {string match} {
         1177  +    run {string match *3*56* 0123456789}
         1178  +} 1
         1179  +test string-11.9.5.$noComp {string match} {
         1180  +    run {string match *3*456*** 0123456789}
         1181  +} 1
         1182  +test string-11.9.6.$noComp {string match} {
         1183  +    run {string match **3*456** 0123456789}
         1184  +} 1
         1185  +test string-11.9.7.$noComp {string match} {
         1186  +    run {string match *3***456* 0123456789}
         1187  +} 1
         1188  +test string-11.9.8.$noComp {string match} {
         1189  +    run {string match *3***\[456]* 0123456789}
         1190  +} 1
         1191  +test string-11.9.9.$noComp {string match} {
         1192  +    run {string match *3***\[4-6]* 0123456789}
         1193  +} 1
         1194  +test string-11.9.10.$noComp {string match} {
         1195  +    run {string match *3***\[4-6] 0123456789}
         1196  +} 0
         1197  +test string-11.9.11.$noComp {string match} {
         1198  +    run {string match *3***\[4-6] 0123456}
         1199  +} 1
         1200  +test string-11.10.$noComp {string match} {
         1201  +    run {string match *3*6*9 01234567890}
         1202  +} 0
         1203  +test string-11.10.1.$noComp {string match} {
         1204  +    run {string match *3*6*89 01234567890}
         1205  +} 0
         1206  +test string-11.10.2.$noComp {string match} {
         1207  +    run {string match *3*456*89 01234567890}
         1208  +} 0
         1209  +test string-11.10.3.$noComp {string match} {
         1210  +    run {string match **3*456*89 01234567890}
         1211  +} 0
         1212  +test string-11.10.4.$noComp {string match} {
         1213  +    run {string match *3*456***89 01234567890}
         1214  +} 0
         1215  +test string-11.11.$noComp {string match} {
         1216  +    run {string match a?c abc}
         1217  +} 1
         1218  +test string-11.12.$noComp {string match} {
         1219  +    run {string match a??c abc}
         1220  +} 0
         1221  +test string-11.13.$noComp {string match} {
         1222  +    run {string match ?1??4???8? 0123456789}
         1223  +} 1
         1224  +test string-11.14.$noComp {string match} {
         1225  +    run {string match {[abc]bc} abc}
         1226  +} 1
         1227  +test string-11.15.$noComp {string match} {
         1228  +    run {string match {a[abc]c} abc}
         1229  +} 1
         1230  +test string-11.16.$noComp {string match} {
         1231  +    run {string match {a[xyz]c} abc}
         1232  +} 0
         1233  +test string-11.17.$noComp {string match} {
         1234  +    run {string match {12[2-7]45} 12345}
         1235  +} 1
         1236  +test string-11.18.$noComp {string match} {
         1237  +    run {string match {12[ab2-4cd]45} 12345}
         1238  +} 1
         1239  +test string-11.19.$noComp {string match} {
         1240  +    run {string match {12[ab2-4cd]45} 12b45}
         1241  +} 1
         1242  +test string-11.20.$noComp {string match} {
         1243  +    run {string match {12[ab2-4cd]45} 12d45}
         1244  +} 1
         1245  +test string-11.21.$noComp {string match} {
         1246  +    run {string match {12[ab2-4cd]45} 12145}
         1247  +} 0
         1248  +test string-11.22.$noComp {string match} {
         1249  +    run {string match {12[ab2-4cd]45} 12545}
         1250  +} 0
         1251  +test string-11.23.$noComp {string match} {
         1252  +    run {string match {a\*b} a*b}
         1253  +} 1
         1254  +test string-11.24.$noComp {string match} {
         1255  +    run {string match {a\*b} ab}
         1256  +} 0
         1257  +test string-11.25.$noComp {string match} {
         1258  +    run {string match {a\*\?\[\]\\\x} "a*?\[\]\\x"}
         1259  +} 1
         1260  +test string-11.26.$noComp {string match} {
         1261  +    run {string match ** ""}
         1262  +} 1
         1263  +test string-11.27.$noComp {string match} {
         1264  +    run {string match *. ""}
         1265  +} 0
         1266  +test string-11.28.$noComp {string match} {
         1267  +    run {string match "" ""}
         1268  +} 1
         1269  +test string-11.29.$noComp {string match} {
         1270  +    run {string match \[a a}
         1271  +} 1
         1272  +test string-11.30.$noComp {string match, bad args} {
         1273  +    list [catch {run {string match - b c}} msg] $msg
  1090   1274   } {1 {bad option "-": must be -nocase}}
  1091         -test string-11.31 {string match case} {
  1092         -    string match a A
         1275  +test string-11.31.$noComp {string match case} {
         1276  +    run {string match a A}
  1093   1277   } 0
  1094         -test string-11.32 {string match nocase} {
  1095         -    string match -n a A
         1278  +test string-11.32.$noComp {string match nocase} {
         1279  +    run {string match -n a A}
  1096   1280   } 1
  1097         -test string-11.33 {string match nocase} {
  1098         -    string match -nocase a\334 A\374
         1281  +test string-11.33.$noComp {string match nocase} {
         1282  +    run {string match -nocase a\334 A\374}
  1099   1283   } 1
  1100         -test string-11.34 {string match nocase} {
  1101         -    string match -nocase a*f ABCDEf
         1284  +test string-11.34.$noComp {string match nocase} {
         1285  +    run {string match -nocase a*f ABCDEf}
  1102   1286   } 1
  1103         -test string-11.35 {string match case, false hope} {
         1287  +test string-11.35.$noComp {string match case, false hope} {
  1104   1288       # This is true because '_' lies between the A-Z and a-z ranges
  1105         -    string match {[A-z]} _
         1289  +    run {string match {[A-z]} _}
  1106   1290   } 1
  1107         -test string-11.36 {string match nocase range} {
         1291  +test string-11.36.$noComp {string match nocase range} {
  1108   1292       # This is false because although '_' lies between the A-Z and a-z ranges,
  1109   1293       # we lower case the end points before checking the ranges.
  1110         -    string match -nocase {[A-z]} _
         1294  +    run {string match -nocase {[A-z]} _}
  1111   1295   } 0
  1112         -test string-11.37 {string match nocase} {
  1113         -    string match -nocase {[A-fh-Z]} g
         1296  +test string-11.37.$noComp {string match nocase} {
         1297  +    run {string match -nocase {[A-fh-Z]} g}
  1114   1298   } 0
  1115         -test string-11.38 {string match case, reverse range} {
  1116         -    string match {[A-fh-Z]} g
         1299  +test string-11.38.$noComp {string match case, reverse range} {
         1300  +    run {string match {[A-fh-Z]} g}
         1301  +} 1
         1302  +test string-11.39.$noComp {string match, *\ case} {
         1303  +    run {string match {*\abc} abc}
         1304  +} 1
         1305  +test string-11.39.1.$noComp {string match, *\ case} {
         1306  +    run {string match {*ab\c} abc}
         1307  +} 1
         1308  +test string-11.39.2.$noComp {string match, *\ case} {
         1309  +    run {string match {*ab\*} ab*}
         1310  +} 1
         1311  +test string-11.39.3.$noComp {string match, *\ case} {
         1312  +    run {string match {*ab\*} abc}
         1313  +} 0
         1314  +test string-11.39.4.$noComp {string match, *\ case} {
         1315  +    run {string match {*ab\\*} {ab\c}}
         1316  +} 1
         1317  +test string-11.39.5.$noComp {string match, *\ case} {
         1318  +    run {string match {*ab\\*} {ab\*}}
         1319  +} 1
         1320  +test string-11.40.$noComp {string match, *special case} {
         1321  +    run {string match {*[ab]} abc}
         1322  +} 0
         1323  +test string-11.41.$noComp {string match, *special case} {
         1324  +    run {string match {*[ab]*} abc}
         1325  +} 1
         1326  +test string-11.42.$noComp {string match, *special case} {
         1327  +    run {string match "*\\" "\\"}
         1328  +} 0
         1329  +test string-11.43.$noComp {string match, *special case} {
         1330  +    run {string match "*\\\\" "\\"}
         1331  +} 1
         1332  +test string-11.44.$noComp {string match, *special case} {
         1333  +    run {string match "*???" "12345"}
         1334  +} 1
         1335  +test string-11.45.$noComp {string match, *special case} {
         1336  +    run {string match "*???" "12"}
         1337  +} 0
         1338  +test string-11.46.$noComp {string match, *special case} {
         1339  +    run {string match "*\\*" "abc*"}
  1117   1340   } 1
  1118         -test string-11.39 {string match, *\ case} {
  1119         -    string match {*\abc} abc
  1120         -} 1
  1121         -test string-11.39.1 {string match, *\ case} {
  1122         -    string match {*ab\c} abc
         1341  +test string-11.47.$noComp {string match, *special case} {
         1342  +    run {string match "*\\*" "*"}
  1123   1343   } 1
  1124         -test string-11.39.2 {string match, *\ case} {
  1125         -    string match {*ab\*} ab*
  1126         -} 1
  1127         -test string-11.39.3 {string match, *\ case} {
  1128         -    string match {*ab\*} abc
         1344  +test string-11.48.$noComp {string match, *special case} {
         1345  +    run {string match "*\\*" "*abc"}
  1129   1346   } 0
  1130         -test string-11.39.4 {string match, *\ case} {
  1131         -    string match {*ab\\*} {ab\c}
         1347  +test string-11.49.$noComp {string match, *special case} {
         1348  +    run {string match "?\\*" "a*"}
  1132   1349   } 1
  1133         -test string-11.39.5 {string match, *\ case} {
  1134         -    string match {*ab\\*} {ab\*}
  1135         -} 1
  1136         -test string-11.40 {string match, *special case} {
  1137         -    string match {*[ab]} abc
  1138         -} 0
  1139         -test string-11.41 {string match, *special case} {
  1140         -    string match {*[ab]*} abc
  1141         -} 1
  1142         -test string-11.42 {string match, *special case} {
  1143         -    string match "*\\" "\\"
         1350  +test string-11.50.$noComp {string match, *special case} {
         1351  +    run {string match "\\" "\\"}
  1144   1352   } 0
  1145         -test string-11.43 {string match, *special case} {
  1146         -    string match "*\\\\" "\\"
  1147         -} 1
  1148         -test string-11.44 {string match, *special case} {
  1149         -    string match "*???" "12345"
         1353  +test string-11.51.$noComp {string match; *, -nocase and UTF-8} {
         1354  +    run {string match -nocase [binary format I 717316707] \
         1355  +	    [binary format I 2028036707]}
  1150   1356   } 1
  1151         -test string-11.45 {string match, *special case} {
  1152         -    string match "*???" "12"
  1153         -} 0
  1154         -test string-11.46 {string match, *special case} {
  1155         -    string match "*\\*" "abc*"
  1156         -} 1
  1157         -test string-11.47 {string match, *special case} {
  1158         -    string match "*\\*" "*"
  1159         -} 1
  1160         -test string-11.48 {string match, *special case} {
  1161         -    string match "*\\*" "*abc"
  1162         -} 0
  1163         -test string-11.49 {string match, *special case} {
  1164         -    string match "?\\*" "a*"
  1165         -} 1
  1166         -test string-11.50 {string match, *special case} {
  1167         -    string match "\\" "\\"
  1168         -} 0
  1169         -test string-11.51 {string match; *, -nocase and UTF-8} {
  1170         -    string match -nocase [binary format I 717316707] \
  1171         -	    [binary format I 2028036707]
  1172         -} 1
  1173         -test string-11.52 {string match, null char in string} {
         1357  +test string-11.52.$noComp {string match, null char in string} {
  1174   1358       set out ""
  1175   1359       set ptn "*abc*"
  1176   1360       foreach elem [list "\[email protected]" "@abc" "\[email protected]\u0000" "blahabcblah"] {
  1177         -	lappend out [string match $ptn $elem]
         1361  +	lappend out [run {string match $ptn $elem}]
  1178   1362       }
  1179   1363       set out
  1180   1364   } {1 1 1 1}
  1181         -test string-11.53 {string match, null char in pattern} {
         1365  +test string-11.53.$noComp {string match, null char in pattern} {
  1182   1366       set out ""
  1183   1367       foreach {ptn elem} [list \
  1184   1368   	    "*\u0000abc\u0000"  "\u0000abc\u0000" \
  1185   1369   	    "*\u0000abc\u0000"  "\u0000abc\u0000ef" \
  1186   1370   	    "*\u0000abc\u0000*" "\u0000abc\u0000ef" \
  1187   1371   	    "*\u0000abc\u0000"  "@\u0000abc\u0000ef" \
  1188   1372   	    "*\u0000abc\u0000*"  "@\u0000abc\u0000ef" \
  1189   1373   	    ] {
  1190         -	lappend out [string match $ptn $elem]
         1374  +	lappend out [run {string match $ptn $elem}]
  1191   1375       }
  1192   1376       set out
  1193   1377   } {1 0 1 0 1}
  1194         -test string-11.54 {string match, failure} {
         1378  +test string-11.54.$noComp {string match, failure} {
  1195   1379       set longString ""
  1196   1380       for {set i 0} {$i < 10} {incr i} {
  1197   1381   	append longString "abcdefghijklmnopqrstuvwxy\u0000z01234567890123"
  1198   1382       }
  1199         -    string first $longString 123
  1200         -    list [string match *cba* $longString] \
  1201         -	    [string match *a*l*\u0000* $longString] \
  1202         -	    [string match *a*l*\u0000*123 $longString] \
  1203         -	    [string match *a*l*\u0000*123* $longString] \
  1204         -	    [string match *a*l*\u0000*cba* $longString] \
  1205         -	    [string match *===* $longString]
         1383  +    run {string first $longString 123}
         1384  +    list [run {string match *cba* $longString}] \
         1385  +	    [run {string match *a*l*\u0000* $longString}] \
         1386  +	    [run {string match *a*l*\u0000*123 $longString}] \
         1387  +	    [run {string match *a*l*\u0000*123* $longString}] \
         1388  +	    [run {string match *a*l*\u0000*cba* $longString}] \
         1389  +	    [run {string match *===* $longString}]
  1206   1390   } {0 1 1 1 0 0}
  1207         -test string-11.55 {string match, invalid binary optimization} {
         1391  +test string-11.55.$noComp {string match, invalid binary optimization} {
  1208   1392       [format string] match \u0141 [binary format c 65]
  1209   1393   } 0
  1210   1394   
  1211         -test string-12.1 {string range} {
  1212         -    list [catch {string range} msg] $msg
         1395  +test stringComp-12.1.0.$noComp {Bug 3588366: end-offsets before start} {
         1396  +    apply {s {
         1397  +        string range $s 0 end-5
         1398  +    }} 12345
         1399  +} {}
         1400  +test string-12.1.$noComp {string range} {
         1401  +    list [catch {run {string range}} msg] $msg
  1213   1402   } {1 {wrong # args: should be "string range string first last"}}
  1214         -test string-12.2 {string range} {
  1215         -    list [catch {string range a 1} msg] $msg
         1403  +test string-12.2.$noComp {string range} {
         1404  +    list [catch {run {string range a 1}} msg] $msg
  1216   1405   } {1 {wrong # args: should be "string range string first last"}}
  1217         -test string-12.3 {string range} {
  1218         -    list [catch {string range a 1 2 3} msg] $msg
         1406  +test string-12.3.$noComp {string range} {
         1407  +    list [catch {run {string range a 1 2 3}} msg] $msg
  1219   1408   } {1 {wrong # args: should be "string range string first last"}}
  1220         -test string-12.4 {string range} {
  1221         -    string range abcdefghijklmnop 2 14
         1409  +test string-12.4.$noComp {string range} {
         1410  +    run {string range abcdefghijklmnop 2 14}
  1222   1411   } {cdefghijklmno}
  1223         -test string-12.5 {string range, last > length} {
  1224         -    string range abcdefghijklmnop 7 1000
         1412  +test string-12.5.$noComp {string range, last > length} {
         1413  +    run {string range abcdefghijklmnop 7 1000}
  1225   1414   } {hijklmnop}
  1226         -test string-12.6 {string range} {
  1227         -    string range abcdefghijklmnop 10 end
         1415  +test string-12.6.$noComp {string range} {
         1416  +    run {string range abcdefghijklmnop 10 end}
  1228   1417   } {klmnop}
  1229         -test string-12.7 {string range, last < first} {
  1230         -    string range abcdefghijklmnop 10 9
         1418  +test string-12.7.$noComp {string range, last < first} {
         1419  +    run {string range abcdefghijklmnop 10 9}
  1231   1420   } {}
  1232         -test string-12.8 {string range, first < 0} {
  1233         -    string range abcdefghijklmnop -3 2
         1421  +test string-12.8.$noComp {string range, first < 0} {
         1422  +    run {string range abcdefghijklmnop -3 2}
  1234   1423   } {abc}
  1235         -test string-12.9 {string range} {
  1236         -    string range abcdefghijklmnop -3 -2
         1424  +test string-12.9.$noComp {string range} {
         1425  +    run {string range abcdefghijklmnop -3 -2}
  1237   1426   } {}
  1238         -test string-12.10 {string range} {
  1239         -    string range abcdefghijklmnop 1000 1010
         1427  +test string-12.10.$noComp {string range} {
         1428  +    run {string range abcdefghijklmnop 1000 1010}
  1240   1429   } {}
  1241         -test string-12.11 {string range} {
  1242         -    string range abcdefghijklmnop -100 end
         1430  +test string-12.11.$noComp {string range} {
         1431  +    run {string range abcdefghijklmnop -100 end}
  1243   1432   } {abcdefghijklmnop}
  1244         -test string-12.12 {string range} {
  1245         -    list [catch {string range abc abc 1} msg] $msg
         1433  +test string-12.12.$noComp {string range} {
         1434  +    list [catch {run {string range abc abc 1}} msg] $msg
  1246   1435   } {1 {bad index "abc": must be integer?[+-]integer? or end?[+-]integer?}}
  1247         -test string-12.13 {string range} {
  1248         -    list [catch {string range abc 1 eof} msg] $msg
         1436  +test string-12.13.$noComp {string range} {
         1437  +    list [catch {run {string range abc 1 eof}} msg] $msg
  1249   1438   } {1 {bad index "eof": must be integer?[+-]integer? or end?[+-]integer?}}
  1250         -test string-12.14 {string range} {
  1251         -    string range abcdefghijklmnop end-1 end
         1439  +test string-12.14.$noComp {string range} {
         1440  +    run {string range abcdefghijklmnop end-1 end}
  1252   1441   } {op}
  1253         -test string-12.15 {string range} {
  1254         -    string range abcdefghijklmnop end 1000
         1442  +test string-12.15.$noComp {string range} {
         1443  +    run {string range abcdefghijklmnop end 1000}
  1255   1444   } {p}
  1256         -test string-12.16 {string range} {
  1257         -    string range abcdefghijklmnop end end-1
         1445  +test string-12.16.$noComp {string range} {
         1446  +    run {string range abcdefghijklmnop end end-1}
  1258   1447   } {}
  1259         -test string-12.17 {string range, unicode} {
  1260         -    string range ab\u7266cdefghijklmnop 5 5
         1448  +test string-12.17.$noComp {string range, unicode} {
         1449  +    run {string range ab\u7266cdefghijklmnop 5 5}
  1261   1450   } e
  1262         -test string-12.18 {string range, unicode} {
  1263         -    string range ab\u7266cdefghijklmnop 2 3
         1451  +test string-12.18.$noComp {string range, unicode} {
         1452  +    run {string range ab\u7266cdefghijklmnop 2 3}
  1264   1453   } \u7266c
  1265         -test string-12.19 {string range, bytearray object} {
         1454  +test string-12.19.$noComp {string range, bytearray object} {
  1266   1455       set b [binary format I* {0x50515253 0x52}]
  1267         -    set r1 [string range $b 1 end-1]
  1268         -    set r2 [string range $b 1 6]
  1269         -    string equal $r1 $r2
         1456  +    set r1 [run {string range $b 1 end-1}]
         1457  +    set r2 [run {string range $b 1 6}]
         1458  +    run {string equal $r1 $r2}
  1270   1459   } 1
  1271         -test string-12.20 {string range, out of bounds indices} {
  1272         -    string range \u00ff 0 1
         1460  +test string-12.20.$noComp {string range, out of bounds indices} {
         1461  +    run {string range \u00ff 0 1}
  1273   1462   } \u00ff
  1274   1463   # Bug 1410553
  1275         -test string-12.21 {string range, regenerates correct reps, bug 1410553} {
         1464  +test string-12.21.$noComp {string range, regenerates correct reps, bug 1410553} {
  1276   1465       set bytes "\x00 \x03 \x41"
  1277   1466       set rxBuffer {}
  1278   1467       foreach ch $bytes {
  1279   1468   	append rxBuffer $ch
  1280   1469   	if {$ch eq "\x03"} {
  1281         -	    string length $rxBuffer
         1470  +	    run {string length $rxBuffer}
  1282   1471   	}
  1283   1472       }
  1284         -    set rxCRC [string range $rxBuffer end-1 end]
         1473  +    set rxCRC [run {string range $rxBuffer end-1 end}]
  1285   1474       binary scan [join $bytes {}] "H*" input_hex
  1286   1475       binary scan $rxBuffer "H*" rxBuffer_hex
  1287   1476       binary scan $rxCRC "H*" rxCRC_hex
  1288   1477       list $input_hex $rxBuffer_hex $rxCRC_hex
  1289   1478   } {000341 000341 0341}
  1290         -test string-12.22 {string range, shimmering binary/index} {
         1479  +test string-12.22.$noComp {string range, shimmering binary/index} {
  1291   1480       set s 0000000001
  1292   1481       binary scan $s a* x
  1293         -    string range $s $s end
         1482  +    run {string range $s $s end}
  1294   1483   } 000000001
  1295         -test string-12.23 {string range, surrogates, bug [11ae2be95dac9417]} fullutf {
  1296         -    list [string range a\U100000b 1 1] [string range a\U100000b 2 2] [string range a\U100000b 3 3]
         1484  +test string-12.23.$noComp {string range, surrogates, bug [11ae2be95dac9417]} fullutf {
         1485  +    run {list [string range a\U100000b 1 1] [string range a\U100000b 2 2] [string range a\U100000b 3 3]}
  1297   1486   } [list \U100000 {} b]
  1298   1487   
  1299         -test string-13.1 {string repeat} {
  1300         -    list [catch {string repeat} msg] $msg
         1488  +test string-13.1.$noComp {string repeat} {
         1489  +    list [catch {run {string repeat}} msg] $msg
  1301   1490   } {1 {wrong # args: should be "string repeat string count"}}
  1302         -test string-13.2 {string repeat} {
  1303         -    list [catch {string repeat abc 10 oops} msg] $msg
         1491  +test string-13.2.$noComp {string repeat} {
         1492  +    list [catch {run {string repeat abc 10 oops}} msg] $msg
  1304   1493   } {1 {wrong # args: should be "string repeat string count"}}
  1305         -test string-13.3 {string repeat} {
  1306         -    string repeat {} 100
         1494  +test string-13.3.$noComp {string repeat} {
         1495  +    run {string repeat {} 100}
  1307   1496   } {}
  1308         -test string-13.4 {string repeat} {
  1309         -    string repeat { } 5
         1497  +test string-13.4.$noComp {string repeat} {
         1498  +    run {string repeat { } 5}
  1310   1499   } {     }
  1311         -test string-13.5 {string repeat} {
  1312         -    string repeat abc 3
         1500  +test string-13.5.$noComp {string repeat} {
         1501  +    run {string repeat abc 3}
  1313   1502   } {abcabcabc}
  1314         -test string-13.6 {string repeat} {
  1315         -    string repeat abc -1
         1503  +test string-13.6.$noComp {string repeat} {
         1504  +    run {string repeat abc -1}
  1316   1505   } {}
  1317         -test string-13.7 {string repeat} {
  1318         -    list [catch {string repeat abc end} msg] $msg
         1506  +test string-13.7.$noComp {string repeat} {
         1507  +    list [catch {run {string repeat abc end}} msg] $msg
  1319   1508   } {1 {expected integer but got "end"}}
  1320         -test string-13.8 {string repeat} {
  1321         -    string repeat {} -1000
         1509  +test string-13.8.$noComp {string repeat} {
         1510  +    run {string repeat {} -1000}
  1322   1511   } {}
  1323         -test string-13.9 {string repeat} {
  1324         -    string repeat {} 0
         1512  +test string-13.9.$noComp {string repeat} {
         1513  +    run {string repeat {} 0}
  1325   1514   } {}
  1326         -test string-13.10 {string repeat} {
  1327         -    string repeat def 0
         1515  +test string-13.10.$noComp {string repeat} {
         1516  +    run {string repeat def 0}
  1328   1517   } {}
  1329         -test string-13.11 {string repeat} {
  1330         -    string repeat def 1
         1518  +test string-13.11.$noComp {string repeat} {
         1519  +    run {string repeat def 1}
  1331   1520   } def
  1332         -test string-13.12 {string repeat} {
  1333         -    string repeat ab\u7266cd 3
         1521  +test string-13.12.$noComp {string repeat} {
         1522  +    run {string repeat ab\u7266cd 3}
  1334   1523   } ab\u7266cdab\u7266cdab\u7266cd
  1335         -test string-13.13 {string repeat} {
  1336         -    string repeat \x00 3
         1524  +test string-13.13.$noComp {string repeat} {
         1525  +    run {string repeat \x00 3}
  1337   1526   } \x00\x00\x00
  1338         -test string-13.14 {string repeat} {
         1527  +test string-13.14.$noComp {string repeat} {
  1339   1528       # The string range will ensure us that string repeat gets a unicode string
  1340         -    string repeat [string range ab\u7266cd 2 3] 3
         1529  +    run {string repeat [run {string range ab\u7266cd 2 3}] 3}
  1341   1530   } \u7266c\u7266c\u7266c
  1342   1531   
  1343         -test string-14.1 {string replace} {
  1344         -    list [catch {string replace} msg] $msg
         1532  +test string-14.1.$noComp {string replace} {
         1533  +    list [catch {run {string replace}} msg] $msg
  1345   1534   } {1 {wrong # args: should be "string replace string first last ?string?"}}
  1346         -test string-14.2 {string replace} {
  1347         -    list [catch {string replace a 1} msg] $msg
         1535  +test string-14.2.$noComp {string replace} {
         1536  +    list [catch {run {string replace a 1}} msg] $msg
  1348   1537   } {1 {wrong # args: should be "string replace string first last ?string?"}}
  1349         -test string-14.3 {string replace} {
  1350         -    list [catch {string replace a 1 2 3 4} msg] $msg
         1538  +test string-14.3.$noComp {string replace} {
         1539  +    list [catch {run {string replace a 1 2 3 4}} msg] $msg
  1351   1540   } {1 {wrong # args: should be "string replace string first last ?string?"}}
  1352         -test string-14.4 {string replace} {
         1541  +test string-14.4.$noComp {string replace} {
  1353   1542   } {}
  1354         -test string-14.5 {string replace} {
  1355         -    string replace abcdefghijklmnop 2 14
         1543  +test string-14.5.$noComp {string replace} {
         1544  +    run {string replace abcdefghijklmnop 2 14}
  1356   1545   } {abp}
  1357         -test string-14.6 {string replace} {
  1358         -    string replace abcdefghijklmnop 7 1000
         1546  +test string-14.6.$noComp {string replace} {
         1547  +    run {string replace abcdefghijklmnop 7 1000}
  1359   1548   } {abcdefg}
  1360         -test string-14.7 {string replace} {
  1361         -    string replace abcdefghijklmnop 10 end
         1549  +test string-14.7.$noComp {string replace} {
         1550  +    run {string replace abcdefghijklmnop 10 end}
  1362   1551   } {abcdefghij}
  1363         -test string-14.8 {string replace} {
  1364         -    string replace abcdefghijklmnop 10 9
         1552  +test string-14.8.$noComp {string replace} {
         1553  +    run {string replace abcdefghijklmnop 10 9}
  1365   1554   } {abcdefghijklmnop}
  1366         -test string-14.9 {string replace} {
  1367         -    string replace abcdefghijklmnop -3 2
         1555  +test string-14.9.$noComp {string replace} {
         1556  +    run {string replace abcdefghijklmnop -3 2}
  1368   1557   } {defghijklmnop}
  1369         -test string-14.10 {string replace} {
  1370         -    string replace abcdefghijklmnop -3 -2
         1558  +test string-14.10.$noComp {string replace} {
         1559  +    run {string replace abcdefghijklmnop -3 -2}
  1371   1560   } {abcdefghijklmnop}
  1372         -test string-14.11 {string replace} {
  1373         -    string replace abcdefghijklmnop 1000 1010
         1561  +test string-14.11.$noComp {string replace} {
         1562  +    run {string replace abcdefghijklmnop 1000 1010}
  1374   1563   } {abcdefghijklmnop}
  1375         -test string-14.12 {string replace} {
  1376         -    string replace abcdefghijklmnop -100 end
         1564  +test string-14.12.$noComp {string replace} {
         1565  +    run {string replace abcdefghijklmnop -100 end}
  1377   1566   } {}
  1378         -test string-14.13 {string replace} {
  1379         -    list [catch {string replace abc abc 1} msg] $msg
         1567  +test string-14.13.$noComp {string replace} {
         1568  +    list [catch {run {string replace abc abc 1}} msg] $msg
  1380   1569   } {1 {bad index "abc": must be integer?[+-]integer? or end?[+-]integer?}}
  1381         -test string-14.14 {string replace} {
  1382         -    list [catch {string replace abc 1 eof} msg] $msg
         1570  +test string-14.14.$noComp {string replace} {
         1571  +    list [catch {run {string replace abc 1 eof}} msg] $msg
  1383   1572   } {1 {bad index "eof": must be integer?[+-]integer? or end?[+-]integer?}}
  1384         -test string-14.15 {string replace} {
  1385         -    string replace abcdefghijklmnop end-10 end-2 NEW
         1573  +test string-14.15.$noComp {string replace} {
         1574  +    run {string replace abcdefghijklmnop end-10 end-2 NEW}
  1386   1575   } {abcdeNEWop}
  1387         -test string-14.16 {string replace} {
  1388         -    string replace abcdefghijklmnop 0 end foo
         1576  +test string-14.16.$noComp {string replace} {
         1577  +    run {string replace abcdefghijklmnop 0 end foo}
  1389   1578   } {foo}
  1390         -test string-14.17 {string replace} {
  1391         -    string replace abcdefghijklmnop end end-1
         1579  +test string-14.17.$noComp {string replace} {
         1580  +    run {string replace abcdefghijklmnop end end-1}
  1392   1581   } {abcdefghijklmnop}
  1393         -test string-14.18 {string replace} {
  1394         -    string replace abcdefghijklmnop 10 9 XXX
         1582  +test string-14.18.$noComp {string replace} {
         1583  +    run {string replace abcdefghijklmnop 10 9 XXX}
  1395   1584   } {abcdefghijklmnop}
  1396         -test string-14.19 {string replace} {
  1397         -    string replace {} -1 0 A
         1585  +test string-14.19.$noComp {string replace} {
         1586  +    run {string replace {} -1 0 A}
  1398   1587   } A
         1588  +test string-14.20.$noComp {string replace} {
         1589  +    run {string replace [makeByteArray abcdefghijklmnop] end-10 end-2\
         1590  +	    [makeByteArray NEW]}
         1591  +} {abcdeNEWop}
  1399   1592   
  1400         -test string-15.1 {string tolower too few args} {
  1401         -    list [catch {string tolower} msg] $msg
         1593  +
         1594  +test stringComp-14.21.$noComp {Bug 82e7f67325} {
         1595  +    apply {x {
         1596  +        set a [join $x {}]
         1597  +        lappend b [string length [string replace ___! 0 2 $a]]
         1598  +        lappend b [string length [string replace ___! 0 2 $a[unset a]]]
         1599  +    }} {a b}
         1600  +} {3 3}
         1601  +test stringComp-14.22.$noComp {Bug 82e7f67325} memory {
         1602  +    # As in stringComp-14.1, but make sure we don't retain too many refs
         1603  +    leaktest {
         1604  +        apply {x {
         1605  +            set a [join $x {}]
         1606  +            lappend b [string length [string replace ___! 0 2 $a]]
         1607  +            lappend b [string length [string replace ___! 0 2 $a[unset a]]]
         1608  +        }} {a b}
         1609  +    }
         1610  +} {0}
         1611  +test stringComp-14.23.$noComp {Bug 0dca3bfa8f} {
         1612  +    apply {arg {
         1613  +        set argCopy $arg
         1614  +        set arg [string replace $arg 1 2 aa]
         1615  +        # Crashes in comparison before fix
         1616  +        expr {$arg ne $argCopy}
         1617  +    }} abcde
         1618  +} 1
         1619  +test stringComp-14.24.$noComp {Bug 1af8de570511} {
         1620  +    apply {{x y} {
         1621  +        # Generate an unshared string value
         1622  +        set val ""
         1623  +        for { set i 0 } { $i < $x } { incr i } {
         1624  +            set val [format "0%s" $val]
         1625  +        }
         1626  +        string replace $val[unset val] 1 1 $y
         1627  +    }} 4 x
         1628  +} 0x00
         1629  +test stringComp-14.25.$noComp {} {
         1630  +    string length [string replace [string repeat a\u00fe 2] 3 end {}]
         1631  +} 3
         1632  +
         1633  +test string-15.1.$noComp {string tolower too few args} {
         1634  +    list [catch {run {string tolower}} msg] $msg
  1402   1635   } {1 {wrong # args: should be "string tolower string ?first? ?last?"}}
  1403         -test string-15.2 {string tolower bad args} {
  1404         -    list [catch {string tolower a b} msg] $msg
         1636  +test string-15.2.$noComp {string tolower bad args} {
         1637  +    list [catch {run {string tolower a b}} msg] $msg
  1405   1638   } {1 {bad index "b": must be integer?[+-]integer? or end?[+-]integer?}}
  1406         -test string-15.3 {string tolower too many args} {
  1407         -    list [catch {string tolower ABC 1 end oops} msg] $msg
         1639  +test string-15.3.$noComp {string tolower too many args} {
         1640  +    list [catch {run {string tolower ABC 1 end oops}} msg] $msg
  1408   1641   } {1 {wrong # args: should be "string tolower string ?first? ?last?"}}
  1409         -test string-15.4 {string tolower} {
  1410         -    string tolower ABCDeF
         1642  +test string-15.4.$noComp {string tolower} {
         1643  +    run {string tolower ABCDeF}
  1411   1644   } {abcdef}
  1412         -test string-15.5 {string tolower} {
  1413         -    string tolower "ABC  XyZ"
         1645  +test string-15.5.$noComp {string tolower} {
         1646  +    run {string tolower "ABC  XyZ"}
  1414   1647   } {abc  xyz}
  1415         -test string-15.6 {string tolower} {
  1416         -    string tolower {123#$&*()}
         1648  +test string-15.6.$noComp {string tolower} {
         1649  +    run {string tolower {123#$&*()}}
  1417   1650   } {123#$&*()}
  1418         -test string-15.7 {string tolower} {
  1419         -    string tolower ABC 1
         1651  +test string-15.7.$noComp {string tolower} {
         1652  +    run {string tolower ABC 1}
  1420   1653   } AbC
  1421         -test string-15.8 {string tolower} {
  1422         -    string tolower ABC 1 end
         1654  +test string-15.8.$noComp {string tolower} {
         1655  +    run {string tolower ABC 1 end}
  1423   1656   } Abc
  1424         -test string-15.9 {string tolower} {
  1425         -    string tolower ABC 0 end-1
         1657  +test string-15.9.$noComp {string tolower} {
         1658  +    run {string tolower ABC 0 end-1}
  1426   1659   } abC
  1427         -test string-15.10 {string tolower, unicode} {
  1428         -     string tolower ABCabc\xc7\xe7
         1660  +test string-15.10.$noComp {string tolower, unicode} {
         1661  +     run {string tolower ABCabc\xc7\xe7}
  1429   1662   } "abcabc\xe7\xe7"
  1430         -test string-15.11 {string tolower, compiled} {
  1431         -    lindex [string tolower [list A B [list C]]] 1
         1663  +test string-15.11.$noComp {string tolower, compiled} {
         1664  +    lindex [run {string tolower [list A B [list C]]}] 1
  1432   1665   } b
  1433   1666   
  1434         -test string-16.1 {string toupper} {
  1435         -    list [catch {string toupper} msg] $msg
         1667  +test string-16.1.$noComp {string toupper} {
         1668  +    list [catch {run {string toupper}} msg] $msg
  1436   1669   } {1 {wrong # args: should be "string toupper string ?first? ?last?"}}
  1437         -test string-16.2 {string toupper} {
  1438         -    list [catch {string toupper a b} msg] $msg
         1670  +test string-16.2.$noComp {string toupper} {
         1671  +    list [catch {run {string toupper a b}} msg] $msg
  1439   1672   } {1 {bad index "b": must be integer?[+-]integer? or end?[+-]integer?}}
  1440         -test string-16.3 {string toupper} {
  1441         -    list [catch {string toupper a 1 end oops} msg] $msg
         1673  +test string-16.3.$noComp {string toupper} {
         1674  +    list [catch {run {string toupper a 1 end oops}} msg] $msg
  1442   1675   } {1 {wrong # args: should be "string toupper string ?first? ?last?"}}
  1443         -test string-16.4 {string toupper} {
  1444         -    string toupper abCDEf
         1676  +test string-16.4.$noComp {string toupper} {
         1677  +    run {string toupper abCDEf}
  1445   1678   } {ABCDEF}
  1446         -test string-16.5 {string toupper} {
  1447         -    string toupper "abc xYz"
         1679  +test string-16.5.$noComp {string toupper} {
         1680  +    run {string toupper "abc xYz"}
  1448   1681   } {ABC XYZ}
  1449         -test string-16.6 {string toupper} {
  1450         -    string toupper {123#$&*()}
         1682  +test string-16.6.$noComp {string toupper} {
         1683  +    run {string toupper {123#$&*()}}
  1451   1684   } {123#$&*()}
  1452         -test string-16.7 {string toupper} {
  1453         -    string toupper abc 1
         1685  +test string-16.7.$noComp {string toupper} {
         1686  +    run {string toupper abc 1}
  1454   1687   } aBc
  1455         -test string-16.8 {string toupper} {
  1456         -    string toupper abc 1 end
         1688  +test string-16.8.$noComp {string toupper} {
         1689  +    run {string toupper abc 1 end}
  1457   1690   } aBC
  1458         -test string-16.9 {string toupper} {
  1459         -    string toupper abc 0 end-1
         1691  +test string-16.9.$noComp {string toupper} {
         1692  +    run {string toupper abc 0 end-1}
  1460   1693   } ABc
  1461         -test string-16.10 {string toupper, unicode} {
  1462         -    string toupper ABCabc\xc7\xe7
         1694  +test string-16.10.$noComp {string toupper, unicode} {
         1695  +    run {string toupper ABCabc\xc7\xe7}
  1463   1696   } "ABCABC\xc7\xc7"
  1464         -test string-16.11 {string toupper, compiled} {
  1465         -    lindex [string toupper [list a b [list c]]] 1
         1697  +test string-16.11.$noComp {string toupper, compiled} {
         1698  +    lindex [run {string toupper [list a b [list c]]}] 1
  1466   1699   } B
  1467   1700   
  1468         -test string-17.1 {string totitle} {
  1469         -    list [catch {string totitle} msg] $msg
         1701  +test string-17.1.$noComp {string totitle} {
         1702  +    list [catch {run {string totitle}} msg] $msg
  1470   1703   } {1 {wrong # args: should be "string totitle string ?first? ?last?"}}
  1471         -test string-17.2 {string totitle} {
  1472         -    list [catch {string totitle a b} msg] $msg
         1704  +test string-17.2.$noComp {string totitle} {
         1705  +    list [catch {run {string totitle a b}} msg] $msg
  1473   1706   } {1 {bad index "b": must be integer?[+-]integer? or end?[+-]integer?}}
  1474         -test string-17.3 {string totitle} {
  1475         -    string totitle abCDEf
         1707  +test string-17.3.$noComp {string totitle} {
         1708  +    run {string totitle abCDEf}
  1476   1709   } {Abcdef}
  1477         -test string-17.4 {string totitle} {
  1478         -    string totitle "abc xYz"
         1710  +test string-17.4.$noComp {string totitle} {
         1711  +    run {string totitle "abc xYz"}
  1479   1712   } {Abc xyz}
  1480         -test string-17.5 {string totitle} {
  1481         -    string totitle {123#$&*()}
         1713  +test string-17.5.$noComp {string totitle} {
         1714  +    run {string totitle {123#$&*()}}
  1482   1715   } {123#$&*()}
  1483         -test string-17.6 {string totitle, unicode} {
  1484         -    string totitle ABCabc\xc7\xe7
         1716  +test string-17.6.$noComp {string totitle, unicode} {
         1717  +    run {string totitle ABCabc\xc7\xe7}
  1485   1718   } "Abcabc\xe7\xe7"
  1486         -test string-17.7 {string totitle, unicode} {
  1487         -    string totitle \u01f3BCabc\xc7\xe7
         1719  +test string-17.7.$noComp {string totitle, unicode} {
         1720  +    run {string totitle \u01f3BCabc\xc7\xe7}
  1488   1721   } "\u01f2bcabc\xe7\xe7"
  1489         -test string-17.8 {string totitle, compiled} {
  1490         -    lindex [string totitle [list aa bb [list cc]]] 0
         1722  +test string-17.8.$noComp {string totitle, compiled} {
         1723  +    lindex [run {string totitle [list aa bb [list cc]]}] 0
  1491   1724   } Aa
  1492   1725   
  1493         -test string-18.1 {string trim} {
  1494         -    list [catch {string trim} msg] $msg
         1726  +test string-18.1.$noComp {string trim} {
         1727  +    list [catch {run {string trim}} msg] $msg
  1495   1728   } {1 {wrong # args: should be "string trim string ?chars?"}}
  1496         -test string-18.2 {string trim} {
  1497         -    list [catch {string trim a b c} msg] $msg
         1729  +test string-18.2.$noComp {string trim} {
         1730  +    list [catch {run {string trim a b c}} msg] $msg
  1498   1731   } {1 {wrong # args: should be "string trim string ?chars?"}}
  1499         -test string-18.3 {string trim} {
  1500         -    string trim "    XYZ      "
         1732  +test string-18.3.$noComp {string trim} {
         1733  +    run {string trim "    XYZ      "}
  1501   1734   } {XYZ}
  1502         -test string-18.4 {string trim} {
  1503         -    string trim "\t\nXYZ\t\n\r\n"
         1735  +test string-18.4.$noComp {string trim} {
         1736  +    run {string trim "\t\nXYZ\t\n\r\n"}
  1504   1737   } {XYZ}
  1505         -test string-18.5 {string trim} {
  1506         -    string trim "  A XYZ A    "
         1738  +test string-18.5.$noComp {string trim} {
         1739  +    run {string trim "  A XYZ A    "}
  1507   1740   } {A XYZ A}
  1508         -test string-18.6 {string trim} {
  1509         -    string trim "XXYYZZABC XXYYZZ" ZYX
         1741  +test string-18.6.$noComp {string trim} {
         1742  +    run {string trim "XXYYZZABC XXYYZZ" ZYX}
  1510   1743   } {ABC }
  1511         -test string-18.7 {string trim} {
  1512         -    string trim "    \t\r      "
         1744  +test string-18.7.$noComp {string trim} {
         1745  +    run {string trim "    \t\r      "}
  1513   1746   } {}
  1514         -test string-18.8 {string trim} {
  1515         -    string trim {abcdefg} {}
         1747  +test string-18.8.$noComp {string trim} {
         1748  +    run {string trim {abcdefg} {}}
  1516   1749   } {abcdefg}
  1517         -test string-18.9 {string trim} {
  1518         -    string trim {}
         1750  +test string-18.9.$noComp {string trim} {
         1751  +    run {string trim {}}
  1519   1752   } {}
  1520         -test string-18.10 {string trim} {
  1521         -    string trim ABC DEF
         1753  +test string-18.10.$noComp {string trim} {
         1754  +    run {string trim ABC DEF}
  1522   1755   } {ABC}
  1523         -test string-18.11 {string trim, unicode} {
  1524         -    string trim "\xe7\xe8 AB\xe7C \xe8\xe7" \xe7\xe8
         1756  +test string-18.11.$noComp {string trim, unicode} {
         1757  +    run {string trim "\xe7\xe8 AB\xe7C \xe8\xe7" \xe7\xe8}
  1525   1758   } " AB\xe7C "
  1526         -test string-18.12 {string trim, unicode default} {
  1527         -    string trim \ufeff\x00\u0085\u00a0\u1680\u180eABC\u1361\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u202f\u205f\u3000
         1759  +test string-18.12.$noComp {string trim, unicode default} {
         1760  +    run {string trim \ufeff\x00\u0085\u00a0\u1680\u180eABC\u1361\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u202f\u205f\u3000}
  1528   1761   } ABC\u1361
  1529   1762   
  1530         -test string-19.1 {string trimleft} {
  1531         -    list [catch {string trimleft} msg] $msg
         1763  +test string-19.1.$noComp {string trimleft} {
         1764  +    list [catch {run {string trimleft}} msg] $msg
  1532   1765   } {1 {wrong # args: should be "string trimleft string ?chars?"}}
  1533         -test string-19.2 {string trimleft} {
  1534         -    string trimleft "    XYZ      "
         1766  +test string-19.2.$noComp {string trimleft} {
         1767  +    run {string trimleft "    XYZ      "}
  1535   1768   } {XYZ      }
  1536         -test string-19.3 {string trimleft, unicode default} {
  1537         -    string trimleft \ufeff\u0085\u00a0\x00\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u202f\u205f\u3000\u1361ABC
         1769  +test string-19.3.$noComp {string trimleft, unicode default} {
         1770  +    run {string trimleft \ufeff\u0085\u00a0\x00\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u202f\u205f\u3000\u1361ABC}
  1538   1771   } \u1361ABC
  1539   1772   
  1540         -test string-20.1 {string trimright errors} {
  1541         -    list [catch {string trimright} msg] $msg
         1773  +test string-20.1.$noComp {string trimright errors} {
         1774  +    list [catch {run {string trimright}} msg] $msg
  1542   1775   } {1 {wrong # args: should be "string trimright string ?chars?"}}
  1543         -test string-20.2 {string trimright errors} {
  1544         -    list [catch {string trimg a} msg] $msg
         1776  +test string-20.2.$noComp {string trimright errors} {
         1777  +    list [catch {run {string trimg a}} msg] $msg
  1545   1778   } {1 {unknown or ambiguous subcommand "trimg": must be bytelength, cat, compare, equal, first, index, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart}}
  1546         -test string-20.3 {string trimright} {
  1547         -    string trimright "    XYZ      "
         1779  +test string-20.3.$noComp {string trimright} {
         1780  +    run {string trimright "    XYZ      "}
  1548   1781   } {    XYZ}
  1549         -test string-20.4 {string trimright} {
  1550         -    string trimright "   "
         1782  +test string-20.4.$noComp {string trimright} {
         1783  +    run {string trimright "   "}
  1551   1784   } {}
  1552         -test string-20.5 {string trimright} {
  1553         -    string trimright ""
         1785  +test string-20.5.$noComp {string trimright} {
         1786  +    run {string trimright ""}
  1554   1787   } {}
  1555         -test string-20.6 {string trimright, unicode default} {
  1556         -    string trimright ABC\u1361\u0085\x00\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u202f\u205f\u3000
         1788  +test string-20.6.$noComp {string trimright, unicode default} {
         1789  +    run {string trimright ABC\u1361\u0085\x00\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u202f\u205f\u3000}
  1557   1790   } ABC\u1361
  1558   1791   
  1559         -test string-21.1 {string wordend} {
  1560         -    list [catch {string wordend a} msg] $msg
         1792  +test string-21.1.$noComp {string wordend} {
         1793  +    list [catch {run {string wordend a}} msg] $msg
  1561   1794   } {1 {wrong # args: should be "string wordend string index"}}
  1562         -test string-21.2 {string wordend} {
  1563         -    list [catch {string wordend a b c} msg] $msg
         1795  +test string-21.2.$noComp {string wordend} {
         1796  +    list [catch {run {string wordend a b c}} msg] $msg
  1564   1797   } {1 {wrong # args: should be "string wordend string index"}}
  1565         -test string-21.3 {string wordend} {
  1566         -    list [catch {string wordend a gorp} msg] $msg
         1798  +test string-21.3.$noComp {string wordend} {
         1799  +    list [catch {run {string wordend a gorp}} msg] $msg
  1567   1800   } {1 {bad index "gorp": must be integer?[+-]integer? or end?[+-]integer?}}
  1568         -test string-21.4 {string wordend} {
  1569         -    string wordend abc. -1
         1801  +test string-21.4.$noComp {string wordend} {
         1802  +    run {string wordend abc. -1}
  1570   1803   } 3
  1571         -test string-21.5 {string wordend} {
  1572         -    string wordend abc. 100
         1804  +test string-21.5.$noComp {string wordend} {
         1805  +    run {string wordend abc. 100}
  1573   1806   } 4
  1574         -test string-21.6 {string wordend} {
  1575         -    string wordend "word_one two three" 2
         1807  +test string-21.6.$noComp {string wordend} {
         1808  +    run {string wordend "word_one two three" 2}
  1576   1809   } 8
  1577         -test string-21.7 {string wordend} {
  1578         -    string wordend "one .&# three" 5
         1810  +test string-21.7.$noComp {string wordend} {
         1811  +    run {string wordend "one .&# three" 5}
  1579   1812   } 6
  1580         -test string-21.8 {string wordend} {
  1581         -    string worde "x.y" 0
         1813  +test string-21.8.$noComp {string wordend} {
         1814  +    run {string worde "x.y" 0}
  1582   1815   } 1
  1583         -test string-21.9 {string wordend} {
  1584         -    string worde "x.y" end-1
         1816  +test string-21.9.$noComp {string wordend} {
         1817  +    run {string worde "x.y" end-1}
  1585   1818   } 2
  1586         -test string-21.10 {string wordend, unicode} {
  1587         -    string wordend "xyz\u00c7de fg" 0
         1819  +test string-21.10.$noComp {string wordend, unicode} {
         1820  +    run {string wordend "xyz\u00c7de fg" 0}
         1821  +} 6
         1822  +test string-21.11.$noComp {string wordend, unicode} {
         1823  +    run {string wordend "xyz\uc700de fg" 0}
  1588   1824   } 6
  1589         -test string-21.11 {string wordend, unicode} {
  1590         -    string wordend "xyz\uc700de fg" 0
         1825  +test string-21.12.$noComp {string wordend, unicode} {
         1826  +    run {string wordend "xyz\u203fde fg" 0}
  1591   1827   } 6
  1592         -test string-21.12 {string wordend, unicode} {
  1593         -    string wordend "xyz\u203fde fg" 0
  1594         -} 6
  1595         -test string-21.13 {string wordend, unicode} {
  1596         -    string wordend "xyz\u2045de fg" 0
         1828  +test string-21.13.$noComp {string wordend, unicode} {
         1829  +    run {string wordend "xyz\u2045de fg" 0}
  1597   1830   } 3
  1598         -test string-21.14 {string wordend, unicode} {
  1599         -    string wordend "\uc700\uc700 abc" 8
         1831  +test string-21.14.$noComp {string wordend, unicode} {
         1832  +    run {string wordend "\uc700\uc700 abc" 8}
  1600   1833   } 6
  1601   1834   
  1602         -test string-22.1 {string wordstart} {
  1603         -    list [catch {string word a} msg] $msg
         1835  +test string-22.1.$noComp {string wordstart} {
         1836  +    list [catch {run {string word a}} msg] $msg
  1604   1837   } {1 {unknown or ambiguous subcommand "word": must be bytelength, cat, compare, equal, first, index, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart}}
  1605         -test string-22.2 {string wordstart} {
  1606         -    list [catch {string wordstart a} msg] $msg
         1838  +test string-22.2.$noComp {string wordstart} {
         1839  +    list [catch {run {string wordstart a}} msg] $msg
  1607   1840   } {1 {wrong # args: should be "string wordstart string index"}}
  1608         -test string-22.3 {string wordstart} {
  1609         -    list [catch {string wordstart a b c} msg] $msg
         1841  +test string-22.3.$noComp {string wordstart} {
         1842  +    list [catch {run {string wordstart a b c}} msg] $msg
  1610   1843   } {1 {wrong # args: should be "string wordstart string index"}}
  1611         -test string-22.4 {string wordstart} {
  1612         -    list [catch {string wordstart a gorp} msg] $msg
         1844  +test string-22.4.$noComp {string wordstart} {
         1845  +    list [catch {run {string wordstart a gorp}} msg] $msg
  1613   1846   } {1 {bad index "gorp": must be integer?[+-]integer? or end?[+-]integer?}}
  1614         -test string-22.5 {string wordstart} {
  1615         -    string wordstart "one two three_words" 400
         1847  +test string-22.5.$noComp {string wordstart} {
         1848  +    run {string wordstart "one two three_words" 400}
  1616   1849   } 8
  1617         -test string-22.6 {string wordstart} {
  1618         -    string wordstart "one two three_words" 2
         1850  +test string-22.6.$noComp {string wordstart} {
         1851  +    run {string wordstart "one two three_words" 2}
  1619   1852   } 0
  1620         -test string-22.7 {string wordstart} {
  1621         -    string wordstart "one two three_words" -2
         1853  +test string-22.7.$noComp {string wordstart} {
         1854  +    run {string wordstart "one two three_words" -2}
  1622   1855   } 0
  1623         -test string-22.8 {string wordstart} {
  1624         -    string wordstart "one .*&^ three" 6
         1856  +test string-22.8.$noComp {string wordstart} {
         1857  +    run {string wordstart "one .*&^ three" 6}
  1625   1858   } 6
  1626         -test string-22.9 {string wordstart} {
  1627         -    string wordstart "one two three" 4
         1859  +test string-22.9.$noComp {string wordstart} {
         1860  +    run {string wordstart "one two three" 4}
  1628   1861   } 4
  1629         -test string-22.10 {string wordstart} {
  1630         -    string wordstart "one two three" end-5
         1862  +test string-22.10.$noComp {string wordstart} {
         1863  +    run {string wordstart "one two three" end-5}
  1631   1864   } 7
  1632         -test string-22.11 {string wordstart, unicode} {
  1633         -    string wordstart "one tw\u00c7o three" 7
         1865  +test string-22.11.$noComp {string wordstart, unicode} {
         1866  +    run {string wordstart "one tw\u00c7o three" 7}
  1634   1867   } 4
  1635         -test string-22.12 {string wordstart, unicode} {
  1636         -    string wordstart "ab\uc700\uc700 cdef ghi" 12
         1868  +test string-22.12.$noComp {string wordstart, unicode} {
         1869  +    run {string wordstart "ab\uc700\uc700 cdef ghi" 12}
  1637   1870   } 10
  1638         -test string-22.13 {string wordstart, unicode} {
  1639         -    string wordstart "\uc700\uc700 abc" 8
         1871  +test string-22.13.$noComp {string wordstart, unicode} {
         1872  +    run {string wordstart "\uc700\uc700 abc" 8}
  1640   1873   } 3
  1641   1874   
  1642         -test string-23.0 {string is boolean, Bug 1187123} testindexobj {
         1875  +test string-23.0.$noComp {string is boolean, Bug 1187123} testindexobj {
  1643   1876       set x 5
  1644   1877       catch {testindexobj $x foo bar soom}
  1645         -    string is boolean $x
         1878  +    run {string is boolean $x}
  1646   1879   } 0
  1647         -test string-23.1 {string is command with empty string} {
         1880  +test string-23.1.$noComp {string is command with empty string} {
  1648   1881       set s ""
  1649   1882       list \
  1650         -        [string is alnum $s] \
  1651         -        [string is alpha $s] \
  1652         -        [string is ascii $s] \
  1653         -        [string is control $s] \
  1654         -        [string is boolean $s] \
  1655         -        [string is digit $s] \
  1656         -        [string is double $s] \
  1657         -        [string is false $s] \
  1658         -        [string is graph $s] \
  1659         -        [string is integer $s] \
  1660         -        [string is lower $s] \
  1661         -        [string is print $s] \
  1662         -        [string is punct $s] \
  1663         -        [string is space $s] \
  1664         -        [string is true $s] \
  1665         -        [string is upper $s] \
  1666         -        [string is wordchar $s] \
  1667         -        [string is xdigit $s] \
         1883  +        [run {string is alnum $s}] \
         1884  +        [run {string is alpha $s}] \
         1885  +        [run {string is ascii $s}] \
         1886  +        [run {string is control $s}] \
         1887  +        [run {string is boolean $s}] \
         1888  +        [run {string is digit $s}] \
         1889  +        [run {string is double $s}] \
         1890  +        [run {string is false $s}] \
         1891  +        [run {string is graph $s}] \
         1892  +        [run {string is integer $s}] \
         1893  +        [run {string is lower $s}] \
         1894  +        [run {string is print $s}] \
         1895  +        [run {string is punct $s}] \
         1896  +        [run {string is space $s}] \
         1897  +        [run {string is true $s}] \
         1898  +        [run {string is upper $s}] \
         1899  +        [run {string is wordchar $s}] \
         1900  +        [run {string is xdigit $s}] \
  1668   1901   
  1669   1902   } {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1}
  1670         -test string-23.2 {string is command with empty string} {
         1903  +test string-23.2.$noComp {string is command with empty string} {
  1671   1904       set s ""
  1672   1905       list \
  1673         -        [string is alnum -strict $s] \
  1674         -        [string is alpha -strict $s] \
  1675         -        [string is ascii -strict $s] \
  1676         -        [string is control -strict $s] \
  1677         -        [string is boolean -strict $s] \
  1678         -        [string is digit -strict $s] \
  1679         -        [string is double -strict $s] \
  1680         -        [string is false -strict $s] \
  1681         -        [string is graph -strict $s] \
  1682         -        [string is integer -strict $s] \
  1683         -        [string is lower -strict $s] \
  1684         -        [string is print -strict $s] \
  1685         -        [string is punct -strict $s] \
  1686         -        [string is space -strict $s] \
  1687         -        [string is true -strict $s] \
  1688         -        [string is upper -strict $s] \
  1689         -        [string is wordchar -strict $s] \
  1690         -        [string is xdigit -strict $s] \
         1906  +        [run {string is alnum -strict $s}] \
         1907  +        [run {string is alpha -strict $s}] \
         1908  +        [run {string is ascii -strict $s}] \
         1909  +        [run {string is control -strict $s}] \
         1910  +        [run {string is boolean -strict $s}] \
         1911  +        [run {string is digit -strict $s}] \
         1912  +        [run {string is double -strict $s}] \
         1913  +        [run {string is false -strict $s}] \
         1914  +        [run {string is graph -strict $s}] \
         1915  +        [run {string is integer -strict $s}] \
         1916  +        [run {string is lower -strict $s}] \
         1917  +        [run {string is print -strict $s}] \
         1918  +        [run {string is punct -strict $s}] \
         1919  +        [run {string is space -strict $s}] \
         1920  +        [run {string is true -strict $s}] \
         1921  +        [run {string is upper -strict $s}] \
         1922  +        [run {string is wordchar -strict $s}] \
         1923  +        [run {string is xdigit -strict $s}] \
  1691   1924   
  1692   1925   } {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
  1693   1926   
  1694         -test string-24.1 {string reverse command} -body {
  1695         -    string reverse
         1927  +test string-24.1.$noComp {string reverse command} -body {
         1928  +    run {string reverse}
  1696   1929   } -returnCodes error -result "wrong # args: should be \"string reverse string\""
  1697         -test string-24.2 {string reverse command} -body {
  1698         -    string reverse a b
         1930  +test string-24.2.$noComp {string reverse command} -body {
         1931  +    run {string reverse a b}
  1699   1932   } -returnCodes error -result "wrong # args: should be \"string reverse string\""
  1700         -test string-24.3 {string reverse command - shared string} {
         1933  +test string-24.3.$noComp {string reverse command - shared string} {
  1701   1934       set x abcde
  1702         -    string reverse $x
         1935  +    run {string reverse $x}
  1703   1936   } edcba
  1704         -test string-24.4 {string reverse command - unshared string} {
         1937  +test string-24.4.$noComp {string reverse command - unshared string} {
  1705   1938       set x abc
  1706   1939       set y de
  1707         -    string reverse $x$y
         1940  +    run {string reverse $x$y}
  1708   1941   } edcba
  1709         -test string-24.5 {string reverse command - shared unicode string} {
         1942  +test string-24.5.$noComp {string reverse command - shared unicode string} {
  1710   1943       set x abcde\ud0ad
  1711         -    string reverse $x
         1944  +    run {string reverse $x}
  1712   1945   } \ud0adedcba
  1713         -test string-24.6 {string reverse command - unshared string} {
         1946  +test string-24.6.$noComp {string reverse command - unshared string} {
  1714   1947       set x abc
  1715   1948       set y de\ud0ad
  1716         -    string reverse $x$y
         1949  +    run {string reverse $x$y}
  1717   1950   } \ud0adedcba
  1718         -test string-24.7 {string reverse command - simple case} {
  1719         -    string reverse a
         1951  +test string-24.7.$noComp {string reverse command - simple case} {
         1952  +    run {string reverse a}
  1720   1953   } a
  1721         -test string-24.8 {string reverse command - simple case} {
  1722         -    string reverse \ud0ad
         1954  +test string-24.8.$noComp {string reverse command - simple case} {
         1955  +    run {string reverse \ud0ad}
  1723   1956   } \ud0ad
  1724         -test string-24.9 {string reverse command - simple case} {
  1725         -    string reverse {}
         1957  +test string-24.9.$noComp {string reverse command - simple case} {
         1958  +    run {string reverse {}}
  1726   1959   } {}
  1727         -test string-24.10 {string reverse command - corner case} {
         1960  +test string-24.10.$noComp {string reverse command - corner case} {
  1728   1961       set x \ubeef\ud0ad
  1729         -    string reverse $x
         1962  +    run {string reverse $x}
         1963  +} \ud0ad\ubeef
         1964  +test string-24.11.$noComp {string reverse command - corner case} {
         1965  +    set x \ubeef
         1966  +    set y \ud0ad
         1967  +    run {string reverse $x$y}
  1730   1968   } \ud0ad\ubeef
  1731         -test string-24.11 {string reverse command - corner case} {
         1969  +test string-24.12.$noComp {string reverse command - corner case} {
  1732   1970       set x \ubeef
  1733   1971       set y \ud0ad
  1734         -    string reverse $x$y
  1735         -} \ud0ad\ubeef
  1736         -test string-24.12 {string reverse command - corner case} {
  1737         -    set x \ubeef
  1738         -    set y \ud0ad
  1739         -    string is ascii [string reverse $x$y]
         1972  +    run {string is ascii [run {string reverse $x$y}]}
  1740   1973   } 0
  1741         -test string-24.13 {string reverse command - pure Unicode string} {
  1742         -    string reverse [string range \ubeef\ud0ad\ubeef\ud0ad\ubeef\ud0ad 1 5]
         1974  +test string-24.13.$noComp {string reverse command - pure Unicode string} {
         1975  +    run {string reverse [run {string range \ubeef\ud0ad\ubeef\ud0ad\ubeef\ud0ad 1 5}]}
  1743   1976   } \ud0ad\ubeef\ud0ad\ubeef\ud0ad
  1744         -test string-24.14 {string reverse command - pure bytearray} {
  1745         -    binary scan [string reverse [binary format H* 010203]] H* x
         1977  +test string-24.14.$noComp {string reverse command - pure bytearray} {
         1978  +    binary scan [run {string reverse [binary format H* 010203]}] H* x
  1746   1979       set x
  1747   1980   } 030201
  1748         -test string-24.15 {string reverse command - pure bytearray} {
  1749         -    binary scan [tcl::string::reverse [binary format H* 010203]] H* x
         1981  +test string-24.15.$noComp {string reverse command - pure bytearray} {
         1982  +    binary scan [run {tcl::string::reverse [binary format H* 010203]}] H* x
  1750   1983       set x
  1751   1984   } 030201
  1752   1985   
  1753         -test string-25.1 {string is list} {
  1754         -    string is list {a b c}
         1986  +test string-25.1.$noComp {string is list} {
         1987  +    run {string is list {a b c}}
  1755   1988   } 1
  1756         -test string-25.2 {string is list} {
  1757         -    string is list "a \{b c"
         1989  +test string-25.2.$noComp {string is list} {
         1990  +    run {string is list "a \{b c"}
         1991  +} 0
         1992  +test string-25.3.$noComp {string is list} {
         1993  +    run {string is list {a {b c}d e}}
  1758   1994   } 0
  1759         -test string-25.3 {string is list} {
  1760         -    string is list {a {b c}d e}
  1761         -} 0
  1762         -test string-25.4 {string is list} {
  1763         -    string is list {}
         1995  +test string-25.4.$noComp {string is list} {
         1996  +    run {string is list {}}
         1997  +} 1
         1998  +test string-25.5.$noComp {string is list} {
         1999  +    run {string is list -strict {a b c}}
  1764   2000   } 1
  1765         -test string-25.5 {string is list} {
  1766         -    string is list -strict {a b c}
  1767         -} 1
  1768         -test string-25.6 {string is list} {
  1769         -    string is list -strict "a \{b c"
         2001  +test string-25.6.$noComp {string is list} {
         2002  +    run {string is list -strict "a \{b c"}
         2003  +} 0
         2004  +test string-25.7.$noComp {string is list} {
         2005  +    run {string is list -strict {a {b c}d e}}
  1770   2006   } 0
  1771         -test string-25.7 {string is list} {
  1772         -    string is list -strict {a {b c}d e}
  1773         -} 0
  1774         -test string-25.8 {string is list} {
  1775         -    string is list -strict {}
         2007  +test string-25.8.$noComp {string is list} {
         2008  +    run {string is list -strict {}}
  1776   2009   } 1
  1777         -test string-25.9 {string is list} {
         2010  +test string-25.9.$noComp {string is list} {
  1778   2011       set x {}
  1779         -    list [string is list -failindex x {a b c}] $x
         2012  +    list [run {string is list -failindex x {a b c}}] $x
  1780   2013   } {1 {}}
  1781         -test string-25.10 {string is list} {
         2014  +test string-25.10.$noComp {string is list} {
  1782   2015       set x {}
  1783         -    list [string is list -failindex x "a \{b c"] $x
         2016  +    list [run {string is list -failindex x "a \{b c"}] $x
  1784   2017   } {0 2}
  1785         -test string-25.11 {string is list} {
         2018  +test string-25.11.$noComp {string is list} {
  1786   2019       set x {}
  1787         -    list [string is list -failindex x {a b {b c}d e}] $x
         2020  +    list [run {string is list -failindex x {a b {b c}d e}}] $x
  1788   2021   } {0 4}
  1789         -test string-25.12 {string is list} {
         2022  +test string-25.12.$noComp {string is list} {
  1790   2023       set x {}
  1791         -    list [string is list -failindex x {}] $x
         2024  +    list [run {string is list -failindex x {}}] $x
  1792   2025   } {1 {}}
  1793         -test string-25.13 {string is list} {
         2026  +test string-25.13.$noComp {string is list} {
  1794   2027       set x {}
  1795         -    list [string is list -failindex x {  {b c}d e}] $x
         2028  +    list [run {string is list -failindex x {  {b c}d e}}] $x
  1796   2029   } {0 2}
  1797         -test string-25.14 {string is list} {
         2030  +test string-25.14.$noComp {string is list} {
  1798   2031       set x {}
  1799         -    list [string is list -failindex x "\uabcd {b c}d e"] $x
         2032  +    list [run {string is list -failindex x "\uabcd {b c}d e"}] $x
  1800   2033   } {0 2}
  1801   2034   
  1802         -test string-26.1 {tcl::prefix, too few args} -body {
         2035  +test string-26.1.$noComp {tcl::prefix, too few args} -body {
  1803   2036       tcl::prefix match a
  1804   2037   } -returnCodes 1 -result {wrong # args: should be "tcl::prefix match ?options? table string"}
  1805         -test string-26.2 {tcl::prefix, bad args} -body {
         2038  +test string-26.2.$noComp {tcl::prefix, bad args} -body {
  1806   2039       tcl::prefix match a b c
  1807   2040   } -returnCodes 1 -result {bad option "a": must be -error, -exact, or -message}
  1808         -test string-26.2.1 {tcl::prefix, empty table} -body {
         2041  +test string-26.2.1.$noComp {tcl::prefix, empty table} -body {
  1809   2042       tcl::prefix match {} foo
  1810   2043   } -returnCodes 1 -result {bad option "foo": no valid options}
  1811         -test string-26.3 {tcl::prefix, bad args} -body {
         2044  +test string-26.3.$noComp {tcl::prefix, bad args} -body {
  1812   2045       tcl::prefix match -error "{}x" -exact str1 str2
  1813   2046   } -returnCodes 1 -result {list element in braces followed by "x" instead of space}
  1814         -test string-26.3.1 {tcl::prefix, bad args} -body {
         2047  +test string-26.3.1.$noComp {tcl::prefix, bad args} -body {
  1815   2048       tcl::prefix match -error "x" -exact str1 str2
  1816   2049   } -returnCodes 1 -result {error options must have an even number of elements}
  1817         -test string-26.3.2 {tcl::prefix, bad args} -body {
         2050  +test string-26.3.2.$noComp {tcl::prefix, bad args} -body {
  1818   2051       tcl::prefix match -error str1 str2
  1819   2052   } -returnCodes 1 -result {missing value for -error}
  1820         -test string-26.4 {tcl::prefix, bad args} -body {
         2053  +test string-26.4.$noComp {tcl::prefix, bad args} -body {
  1821   2054       tcl::prefix match -message str1 str2
  1822   2055   } -returnCodes 1 -result {missing value for -message}
  1823         -test string-26.5 {tcl::prefix} {
         2056  +test string-26.5.$noComp {tcl::prefix} {
  1824   2057       tcl::prefix match {apa bepa cepa depa} cepa
  1825   2058   } cepa
  1826         -test string-26.6 {tcl::prefix} {
         2059  +test string-26.6.$noComp {tcl::prefix} {
  1827   2060       tcl::prefix match {apa bepa cepa depa} be
  1828   2061   } bepa
  1829         -test string-26.7 {tcl::prefix} -body {
         2062  +test string-26.7.$noComp {tcl::prefix} -body {
  1830   2063       tcl::prefix match -exact {apa bepa cepa depa} be
  1831   2064   } -returnCodes 1 -result {bad option "be": must be apa, bepa, cepa, or depa}
  1832         -test string-26.8 {tcl::prefix} -body {
         2065  +test string-26.8.$noComp {tcl::prefix} -body {
  1833   2066       tcl::prefix match -message wombat {apa bepa bear depa} be
  1834   2067   } -returnCodes 1 -result {ambiguous wombat "be": must be apa, bepa, bear, or depa}
  1835         -test string-26.9 {tcl::prefix} -body {
         2068  +test string-26.9.$noComp {tcl::prefix} -body {
  1836   2069       tcl::prefix match -error {} {apa bepa bear depa} be
  1837   2070   } -returnCodes 0 -result {}
  1838         -test string-26.10 {tcl::prefix} -body {
         2071  +test string-26.10.$noComp {tcl::prefix} -body {
  1839   2072       tcl::prefix match -error {-level 1} {apa bepa bear depa} be
  1840   2073   } -returnCodes 2 -result {ambiguous option "be": must be apa, bepa, bear, or depa}
  1841         -test string-26.10.1 {tcl::prefix} -setup {
         2074  +test string-26.10.1.$noComp {tcl::prefix} -setup {
  1842   2075       proc _testprefix {args} {
  1843   2076           array set opts {-a x -b y -c y}
  1844   2077           foreach {opt val} $args {
  1845   2078               set opt [tcl::prefix match -error {-level 1} {-a -b -c} $opt]
  1846   2079               set opts($opt) $val
  1847   2080           }
  1848   2081           array get opts
................................................................................
  1870   2103               set end [lindex [lindex [split [memory info] "\n"] 3] 3]
  1871   2104           }
  1872   2105           lappend res [expr {$end - $tmp}]
  1873   2106       }
  1874   2107       return $res
  1875   2108   }
  1876   2109   
  1877         -test string-26.11 {tcl::prefix: testing for leaks} -body {
         2110  +test string-26.11.$noComp {tcl::prefix: testing for leaks} -body {
  1878   2111       # This test is made to stress object reference management
  1879   2112       MemStress {
  1880   2113           set table {hejj miff gurk}
  1881   2114           set item [lindex $table 1]
  1882   2115           # If not careful, this can cause a circular reference
  1883   2116           # that will cause a leak.
  1884   2117           tcl::prefix match $table $item
................................................................................
  1891   2124           # A similar case with dict
  1892   2125           set table3 {hejj {miff maff} gurk2}
  1893   2126           set item [lindex [dict keys [lindex $table3 1]] 0]
  1894   2127           tcl::prefix match $table3 $item
  1895   2128       }
  1896   2129   } -constraints memory -result {0 0 0}
  1897   2130   
  1898         -test string-26.12 {tcl::prefix: testing for leaks} -body {
         2131  +test string-26.12.$noComp {tcl::prefix: testing for leaks} -body {
  1899   2132       # This is a memory leak test in a form that might actually happen
  1900   2133       # in real code.  The shared literal "miff" causes a connection
  1901   2134       # between the item and the table.
  1902   2135       MemStress {
  1903   2136           proc stress1 {item} {
  1904   2137               set table [list hejj miff gurk]
  1905   2138               tcl::prefix match $table $item
................................................................................
  1909   2142           }
  1910   2143           stress2
  1911   2144           rename stress1 {}
  1912   2145           rename stress2 {}
  1913   2146       }
  1914   2147   } -constraints memory -result 0
  1915   2148   
  1916         -test string-26.13 {tcl::prefix: testing for leaks} -body {
         2149  +test string-26.13.$noComp {tcl::prefix: testing for leaks} -body {
  1917   2150       # This test is made to stress object reference management
  1918   2151       MemStress {
  1919   2152           set table [list hejj miff]
  1920   2153           set item $table
  1921   2154           set error $table
  1922   2155           # Use the same objects in all places
  1923   2156           catch {
  1924   2157               tcl::prefix match -error $error $table $item
  1925   2158           }
  1926   2159       }
  1927   2160   } -constraints memory -result {0}
  1928   2161   
  1929         -test string-27.1 {tcl::prefix all, too few args} -body {
         2162  +test string-27.1.$noComp {tcl::prefix all, too few args} -body {
  1930   2163       tcl::prefix all a
  1931   2164   } -returnCodes 1 -result {wrong # args: should be "tcl::prefix all table string"}
  1932         -test string-27.2 {tcl::prefix all, bad args} -body {
         2165  +test string-27.2.$noComp {tcl::prefix all, bad args} -body {
  1933   2166       tcl::prefix all a b c
  1934   2167   } -returnCodes 1 -result {wrong # args: should be "tcl::prefix all table string"}
  1935         -test string-27.3 {tcl::prefix all, bad args} -body {
         2168  +test string-27.3.$noComp {tcl::prefix all, bad args} -body {
  1936   2169       tcl::prefix all "{}x" str2
  1937   2170   } -returnCodes 1 -result {list element in braces followed by "x" instead of space}
  1938         -test string-27.4 {tcl::prefix all} {
         2171  +test string-27.4.$noComp {tcl::prefix all} {
  1939   2172       tcl::prefix all {apa bepa cepa depa} c
  1940   2173   } cepa
  1941         -test string-27.5 {tcl::prefix all} {
         2174  +test string-27.5.$noComp {tcl::prefix all} {
  1942   2175       tcl::prefix all {apa bepa cepa depa} cepa
  1943   2176   } cepa
  1944         -test string-27.6 {tcl::prefix all} {
         2177  +test string-27.6.$noComp {tcl::prefix all} {
  1945   2178       tcl::prefix all {apa bepa cepa depa} cepax
  1946   2179   } {}
  1947         -test string-27.7 {tcl::prefix all} {
         2180  +test string-27.7.$noComp {tcl::prefix all} {
  1948   2181       tcl::prefix all {apa aska appa} a
  1949   2182   } {apa aska appa}
  1950         -test string-27.8 {tcl::prefix all} {
         2183  +test string-27.8.$noComp {tcl::prefix all} {
  1951   2184       tcl::prefix all {apa aska appa} ap
  1952   2185   } {apa appa}
  1953         -test string-27.9 {tcl::prefix all} {
         2186  +test string-27.9.$noComp {tcl::prefix all} {
  1954   2187       tcl::prefix all {apa aska appa} p
  1955   2188   } {}
  1956         -test string-27.10 {tcl::prefix all} {
         2189  +test string-27.10.$noComp {tcl::prefix all} {
  1957   2190       tcl::prefix all {apa aska appa} {}
  1958   2191   } {apa aska appa}
  1959   2192   
  1960         -test string-28.1 {tcl::prefix longest, too few args} -body {
         2193  +test string-28.1.$noComp {tcl::prefix longest, too few args} -body {
  1961   2194       tcl::prefix longest a
  1962   2195   } -returnCodes 1 -result {wrong # args: should be "tcl::prefix longest table string"}
  1963         -test string-28.2 {tcl::prefix longest, bad args} -body {
         2196  +test string-28.2.$noComp {tcl::prefix longest, bad args} -body {
  1964   2197       tcl::prefix longest a b c
  1965   2198   } -returnCodes 1 -result {wrong # args: should be "tcl::prefix longest table string"}
  1966         -test string-28.3 {tcl::prefix longest, bad args} -body {
         2199  +test string-28.3.$noComp {tcl::prefix longest, bad args} -body {
  1967   2200       tcl::prefix longest "{}x" str2
  1968   2201   } -returnCodes 1 -result {list element in braces followed by "x" instead of space}
  1969         -test string-28.4 {tcl::prefix longest} {
         2202  +test string-28.4.$noComp {tcl::prefix longest} {
  1970   2203       tcl::prefix longest {apa bepa cepa depa} c
  1971   2204   } cepa
  1972         -test string-28.5 {tcl::prefix longest} {
         2205  +test string-28.5.$noComp {tcl::prefix longest} {
  1973   2206       tcl::prefix longest {apa bepa cepa depa} cepa
  1974   2207   } cepa
  1975         -test string-28.6 {tcl::prefix longest} {
         2208  +test string-28.6.$noComp {tcl::prefix longest} {
  1976   2209       tcl::prefix longest {apa bepa cepa depa} cepax
  1977   2210   } {}
  1978         -test string-28.7 {tcl::prefix longest} {
         2211  +test string-28.7.$noComp {tcl::prefix longest} {
  1979   2212       tcl::prefix longest {apa aska appa} a
  1980   2213   } a
  1981         -test string-28.8 {tcl::prefix longest} {
         2214  +test string-28.8.$noComp {tcl::prefix longest} {
  1982   2215       tcl::prefix longest {apa aska appa} ap
  1983   2216   } ap
  1984         -test string-28.9 {tcl::prefix longest} {
         2217  +test string-28.9.$noComp {tcl::prefix longest} {
  1985   2218       tcl::prefix longest {apa bska appa} a
  1986   2219   } ap
  1987         -test string-28.10 {tcl::prefix longest} {
         2220  +test string-28.10.$noComp {tcl::prefix longest} {
  1988   2221       tcl::prefix longest {apa bska appa} {}
  1989   2222   } {}
  1990         -test string-28.11 {tcl::prefix longest} {
         2223  +test string-28.11.$noComp {tcl::prefix longest} {
  1991   2224       tcl::prefix longest {{} bska appa} {}
  1992   2225   } {}
  1993         -test string-28.12 {tcl::prefix longest} {
         2226  +test string-28.12.$noComp {tcl::prefix longest} {
  1994   2227       tcl::prefix longest {apa {} appa} {}
  1995   2228   } {}
  1996         -test string-28.13 {tcl::prefix longest} {
         2229  +test string-28.13.$noComp {tcl::prefix longest} {
  1997   2230       # Test UTF8 handling
  1998   2231       tcl::prefix longest {ax\x90 bep ax\x91} a
  1999   2232   } ax
  2000   2233   
  2001         -test string-29.1 {string cat, no arg} {
  2002         -    string cat
         2234  +test string-29.1.$noComp {string cat, no arg} {
         2235  +    run {string cat}
  2003   2236   } ""
  2004         -test string-29.2 {string cat, single arg} {
         2237  +test string-29.2.$noComp {string cat, single arg} {
  2005   2238       set x FOO
  2006         -    string compare $x [string cat $x]
         2239  +    run {string compare $x [run {string cat $x}]}
  2007   2240   } 0
  2008         -test string-29.3 {string cat, two args} {
         2241  +test string-29.3.$noComp {string cat, two args} {
  2009   2242       set x FOO
  2010         -    string compare $x$x [string cat $x $x]
         2243  +    run {string compare $x$x [run {string cat $x $x}]}
  2011   2244   } 0
  2012         -test string-29.4 {string cat, many args} {
         2245  +test string-29.4.$noComp {string cat, many args} {
  2013   2246       set x FOO
  2014   2247       set n 260
  2015         -    set xx [string repeat $x $n]
  2016         -    set vv [string repeat {$x} $n]
  2017         -    set vvs [string repeat {$x } $n]
  2018         -    set r1 [string compare $xx [subst $vv]]
  2019         -    set r2 [string compare $xx [eval "string cat $vvs"]]
         2248  +    set xx [run {string repeat $x $n}]
         2249  +    set vv [run {string repeat {$x} $n}]
         2250  +    set vvs [run {string repeat {$x } $n}]
         2251  +    set r1 [run {string compare $xx [subst $vv]}]
         2252  +    set r2 [run {string compare $xx [eval "run {string cat $vvs}"]}]
  2020   2253       list $r1 $r2
  2021   2254   } {0 0}
  2022         -test string-29.5 {string cat, efficiency} -body {
  2023         -    tcl::unsupported::representation [string cat [list x] [list]]
         2255  +if {$noComp} {
         2256  +test string-29.5.$noComp {string cat, efficiency} -body {
         2257  +    tcl::unsupported::representation [run {string cat [list x] [list]}]
         2258  +} -match glob -result {*no string representation}
         2259  +test string-29.6.$noComp {string cat, efficiency} -body {
         2260  +    tcl::unsupported::representation [run {string cat [list] [list x]}]
         2261  +} -match glob -result {*no string representation}
         2262  +test string-29.7.$noComp {string cat, efficiency} -body {
         2263  +    tcl::unsupported::representation [run {string cat [list x] [list] [list]}]
  2024   2264   } -match glob -result {*no string representation}
  2025         -test string-29.6 {string cat, efficiency} -body {
  2026         -    tcl::unsupported::representation [string cat [list] [list x]]
         2265  +test string-29.8.$noComp {string cat, efficiency} -body {
         2266  +    tcl::unsupported::representation [run {string cat [list] [list x] [list]}]
  2027   2267   } -match glob -result {*no string representation}
  2028         -test string-29.7 {string cat, efficiency} -body {
  2029         -    tcl::unsupported::representation [string cat [list x] [list] [list]]
         2268  +test string-29.9.$noComp {string cat, efficiency} -body {
         2269  +    tcl::unsupported::representation [run {string cat [list] [list] [list x]}]
  2030   2270   } -match glob -result {*no string representation}
  2031         -test string-29.8 {string cat, efficiency} -body {
  2032         -    tcl::unsupported::representation [string cat [list] [list x] [list]]
  2033         -} -match glob -result {*no string representation}
  2034         -test string-29.9 {string cat, efficiency} -body {
  2035         -    tcl::unsupported::representation [string cat [list] [list] [list x]]
  2036         -} -match glob -result {*no string representation}
  2037         -test string-29.10 {string cat, efficiency} -body {
  2038         -    tcl::unsupported::representation [string cat [list x] [list x]]
         2271  +test string-29.10.$noComp {string cat, efficiency} -body {
         2272  +    tcl::unsupported::representation [run {string cat [list x] [list x]}]
  2039   2273   } -match glob -result {*, string representation "xx"}
  2040         -test string-29.11 {string cat, efficiency} -body {
         2274  +test string-29.11.$noComp {string cat, efficiency} -body {
  2041   2275       tcl::unsupported::representation \
  2042         -	[string cat [list x] [encoding convertto utf-8 {}]]
         2276  +	[run {string cat [list x] [encoding convertto utf-8 {}]}]
  2043   2277   } -match glob -result {*no string representation}
  2044         -test string-29.12 {string cat, efficiency} -body {
         2278  +test string-29.12.$noComp {string cat, efficiency} -body {
  2045   2279       tcl::unsupported::representation \
  2046         -	[string cat [encoding convertto utf-8 {}] [list x]]
         2280  +	[run {string cat [encoding convertto utf-8 {}] [list x]}]
  2047   2281   } -match glob -result {*, string representation "x"}
  2048         -test string-29.13 {string cat, efficiency} -body {
  2049         -    tcl::unsupported::representation [string cat \
  2050         -	[encoding convertto utf-8 {}] [encoding convertto utf-8 {}] [list x]]
         2282  +test string-29.13.$noComp {string cat, efficiency} -body {
         2283  +    tcl::unsupported::representation [run {string cat \
         2284  +	[encoding convertto utf-8 {}] [encoding convertto utf-8 {}] [list x]}]
  2051   2285   } -match glob -result {*, string representation "x"}
  2052         -test string-29.14 {string cat, efficiency} -setup {
         2286  +test string-29.14.$noComp {string cat, efficiency} -setup {
  2053   2287       set e [encoding convertto utf-8 {}]
  2054   2288   } -cleanup {
  2055   2289       unset e
  2056   2290   } -body {
  2057         -    tcl::unsupported::representation [string cat $e $e [list x]]
         2291  +    tcl::unsupported::representation [run {string cat $e $e [list x]}]
  2058   2292   } -match glob -result {*no string representation}
  2059         -test string-29.15 {string cat, efficiency} -setup {
         2293  +test string-29.15.$noComp {string cat, efficiency} -setup {
  2060   2294       set e [encoding convertto utf-8 {}]
  2061   2295       set f [encoding convertto utf-8 {}]
  2062   2296   } -cleanup {
  2063   2297       unset e f
  2064   2298   } -body {
  2065         -    tcl::unsupported::representation [string cat $e $f $e $f [list x]]
         2299  +    tcl::unsupported::representation [run {string cat $e $f $e $f [list x]}]
  2066   2300   } -match glob -result {*no string representation}
  2067         -
         2301  +}
         2302  +
         2303  +}
         2304  +
  2068   2305   # cleanup
  2069   2306   rename MemStress {}
         2307  +rename makeByteArray {}
         2308  +rename makeUnicode {}
         2309  +rename makeList {}
         2310  +rename makeShared {}
  2070   2311   catch {rename foo {}}
  2071   2312   ::tcltest::cleanupTests
  2072   2313   return
  2073   2314   
  2074   2315   # Local Variables:
  2075   2316   # mode: tcl
  2076   2317   # End:

Deleted tests/stringComp.test.

     1         -# Commands covered:  string
     2         -#
     3         -# This file contains a collection of tests for one or more of the Tcl
     4         -# built-in commands.  Sourcing this file into Tcl runs the tests and
     5         -# generates output for errors.  No output means no errors were found.
     6         -#
     7         -# This differs from the original string tests in that the tests call
     8         -# things in procs, which uses the compiled string code instead of
     9         -# the runtime parse string code.  The tests of import should match
    10         -# their equivalent number in string.test.
    11         -#
    12         -# Copyright (c) 2001 by ActiveState Corporation.
    13         -# Copyright (c) 2001 by Kevin B. Kenny.  All rights reserved.
    14         -#
    15         -# See the file "license.terms" for information on usage and redistribution
    16         -# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    17         -
    18         -if {[lsearch [namespace children] ::tcltest] == -1} {
    19         -    package require tcltest
    20         -    namespace import -force ::tcltest::*
    21         -}
    22         -
    23         -::tcltest::loadTestedCommands
    24         -catch [list package require -exact Tcltest [info patchlevel]]
    25         -
    26         -# Some tests require the testobj command
    27         -
    28         -testConstraint testobj [expr {[info commands testobj] != {}}]
    29         -testConstraint memory [llength [info commands memory]]
    30         -if {[testConstraint memory]} {
    31         -    proc getbytes {} {
    32         -	set lines [split [memory info] \n]
    33         -	return [lindex $lines 3 3]
    34         -    }
    35         -    proc leaktest {script {iterations 3}} {
    36         -	set end [getbytes]
    37         -	for {set i 0} {$i < $iterations} {incr i} {
    38         -	    uplevel 1 $script
    39         -	    set tmp $end
    40         -	    set end [getbytes]
    41         -	}
    42         -	return [expr {$end - $tmp}]
    43         -    }
    44         -}
    45         -
    46         -test stringComp-1.1 {error conditions} {
    47         -    proc foo {} {string gorp a b}
    48         -    list [catch {foo} msg] $msg
    49         -} {1 {unknown or ambiguous subcommand "gorp": must be bytelength, cat, compare, equal, first, index, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart}}
    50         -test stringComp-1.2 {error conditions} {
    51         -    proc foo {} {string}
    52         -    list [catch {foo} msg] $msg
    53         -} {1 {wrong # args: should be "string subcommand ?arg ...?"}}
    54         -test stringComp-1.3 {error condition - undefined method during compile} {
    55         -    # We don't want this to complain about 'never' because it may never
    56         -    # be called, or string may get redefined.  This must compile OK.
    57         -    proc foo {str i} {
    58         -        if {"yes" == "no"} { string never called but complains here }
    59         -        string index $str $i
    60         -    }
    61         -    foo abc 0
    62         -} a
    63         -
    64         -## Test string compare|equal over equal constraints
    65         -## Use result for string compare, and negate it for string equal
    66         -## The body will be tested both in and outside a proc
    67         -set i 0
    68         -foreach {tname tbody tresult tcode} {
    69         -    {too few args} {
    70         -	string compare a
    71         -    } {wrong # args: should be "string compare ?-nocase? ?-length int? string1 string2"} {error}
    72         -    {bad args} {
    73         -	string compare a b c
    74         -    } {bad option "a": must be -nocase or -length} {error}
    75         -    {bad args} {
    76         -	string compare -length -nocase str1 str2
    77         -    } {expected integer but got "-nocase"} {error}
    78         -    {too many args} {
    79         -	string compare -length 10 -nocase str1 str2 str3
    80         -    } {wrong # args: should be "string compare ?-nocase? ?-length int? string1 string2"} {error}
    81         -    {compare with length unspecified} {
    82         -	string compare -length 10 10
    83         -    } {wrong # args: should be "string compare ?-nocase? ?-length int? string1 string2"} {error}
    84         -    {basic operation fail} {
    85         -	string compare abcde abdef
    86         -    } {-1} {}
    87         -    {basic operation success} {
    88         -	string compare abcde abcde
    89         -    } {0} {}
    90         -    {with length} {
    91         -	string compare -length 2 abcde abxyz
    92         -    } {0} {}
    93         -    {with special index} {
    94         -	string compare -length end-3 abcde abxyz
    95         -    } {expected integer but got "end-3"} {error}
    96         -    {unicode} {
    97         -	string compare ab\u7266 ab\u7267
    98         -    } {-1} {}
    99         -    {unicode} {string compare \334 \u00dc} 0 {}
   100         -    {unicode} {string compare \334 \u00fc} -1 {}
   101         -    {unicode} {string compare \334\334\334\374\374 \334\334\334\334\334} 1 {}
   102         -    {high bit} {
   103         -	# This test will fail if the underlying comparaison
   104         -	# is using signed chars instead of unsigned chars.
   105         -	# (like SunOS's default memcmp thus the compat/memcmp.c)
   106         -	string compare "\x80" "@"
   107         -	# Nb this tests works also in utf8 space because \x80 is
   108         -	# translated into a 2 or more bytelength but whose first byte has
   109         -	# the high bit set.
   110         -    } {1} {}
   111         -    {-nocase 1} {string compare -nocase abcde abdef} {-1} {}
   112         -    {-nocase 2} {string compare -nocase abcde Abdef} {-1} {}
   113         -    {-nocase 3} {string compare -nocase abcde ABCDE} {0} {}
   114         -    {-nocase 4} {string compare -nocase abcde abcde} {0} {}
   115         -    {-nocase unicode} {
   116         -	string compare -nocase \334 \u00dc
   117         -    } 0 {}
   118         -    {-nocase unicode} {
   119         -	string compare -nocase \334\334\334\374\u00fc \334\334\334\334\334
   120         -    } 0 {}
   121         -    {-nocase with length} {
   122         -	string compare -length 2 -nocase abcde Abxyz
   123         -    } {0} {}
   124         -    {-nocase with length} {
   125         -	string compare -nocase -length 3 abcde Abxyz
   126         -    } {-1} {}
   127         -    {-nocase with length <= 0} {
   128         -	string compare -nocase -length -1 abcde AbCdEf
   129         -    } {-1} {}
   130         -    {-nocase with excessive length} {
   131         -	string compare -nocase -length 50 AbCdEf abcde
   132         -    } {1} {}
   133         -    {-len unicode} {
   134         -	# These are strings that are 6 BYTELENGTH long, but the length
   135         -	# shouldn't make a different because there are actually 3 CHARS long
   136         -	string compare -len 5 \334\334\334 \334\334\374
   137         -    } -1 {}
   138         -    {-nocase with special index} {
   139         -	string compare -nocase -length end-3 Abcde abxyz
   140         -    } {expected integer but got "end-3"} error
   141         -    {null strings} {
   142         -	string compare "" ""
   143         -    } 0 {}
   144         -    {null strings} {
   145         -	string compare "" foo
   146         -    } -1 {}
   147         -    {null strings} {
   148         -	string compare foo ""
   149         -    } 1 {}
   150         -    {-nocase null strings} {
   151         -	string compare -nocase "" ""
   152         -    } 0 {}
   153         -    {-nocase null strings} {
   154         -	string compare -nocase "" foo
   155         -    } -1 {}
   156         -    {-nocase null strings} {
   157         -	string compare -nocase foo ""
   158         -    } 1 {}
   159         -    {with length, unequal strings} {
   160         -	string compare -length 2 abc abde
   161         -    } 0 {}
   162         -    {with length, unequal strings} {
   163         -	string compare -length 2 ab abde
   164         -    } 0 {}
   165         -    {with NUL character vs. other ASCII} {
   166         -	# Be careful here, since UTF-8 rep comparison with memcmp() of
   167         -	# these puts chars in the wrong order
   168         -	string compare \x00 \x01
   169         -    } -1 {}
   170         -    {high bit} {
   171         -	string compare "a\x80" "[email protected]"
   172         -    } 1 {}
   173         -    {high bit} {
   174         -	string compare "a\x00" "a\x01"
   175         -    } -1 {}
   176         -    {high bit} {
   177         -	string compare "\x00\x00" "\x00\x01"
   178         -    } -1 {}
   179         -    {binary equal} {
   180         -	string compare [binary format a100 0] [binary format a100 0]
   181         -    } 0 {}
   182         -    {binary neq} {
   183         -	string compare [binary format a100a 0 1] [binary format a100a 0 0]
   184         -    } 1 {}
   185         -    {binary neq inequal length} {
   186         -	string compare [binary format a20a 0 1] [binary format a100a 0 0]
   187         -    } 1 {}
   188         -} {
   189         -    if {$tname eq ""} { continue }
   190         -    if {$tcode eq ""} { set tcode ok }
   191         -    test stringComp-2.[incr i] "string compare, $tname" \
   192         -	-body [list eval $tbody] \
   193         -	-returnCodes $tcode -result $tresult
   194         -    test stringComp-2.[incr i] "string compare bc, $tname" \
   195         -	-body "[list proc foo {} $tbody];foo" \
   196         -	-returnCodes $tcode -result $tresult
   197         -    if {"error" ni $tcode} {
   198         -	set tresult [expr {!$tresult}]
   199         -    } else {
   200         -	set tresult [string map {compare equal} $tresult]
   201         -    }
   202         -    set tbody [string map {compare equal} $tbody]
   203         -    test stringComp-2.[incr i] "string equal, $tname" \
   204         -	-body [list eval $tbody] \
   205         -	-returnCodes $tcode -result $tresult
   206         -    test stringComp-2.[incr i] "string equal bc, $tname" \
   207         -	-body "[list proc foo {} $tbody];foo" \
   208         -	-returnCodes $tcode -result $tresult
   209         -}
   210         -
   211         -# need a few extra tests short abbr cmd
   212         -test stringComp-3.1 {string compare, shortest method name} {
   213         -    proc foo {} {string co abcde ABCDE}
   214         -    foo
   215         -} 1
   216         -test stringComp-3.2 {string equal, shortest method name} {
   217         -    proc foo {} {string e abcde ABCDE}
   218         -    foo
   219         -} 0
   220         -test stringComp-3.3 {string equal -nocase} {
   221         -    proc foo {} {string eq -nocase abcde ABCDE}
   222         -    foo
   223         -} 1
   224         -
   225         -test stringComp-4.1 {string first, too few args} {
   226         -    proc foo {} {string first a}
   227         -    list [catch {foo} msg] $msg
   228         -} {1 {wrong # args: should be "string first needleString haystackString ?startIndex?"}}
   229         -test stringComp-4.2 {string first, bad args} {
   230         -    proc foo {} {string first a b c}
   231         -    list [catch {foo} msg] $msg
   232         -} {1 {bad index "c": must be integer?[+-]integer? or end?[+-]integer?}}
   233         -test stringComp-4.3 {string first, too many args} {
   234         -    proc foo {} {string first a b 5 d}
   235         -    list [catch {foo} msg] $msg
   236         -} {1 {wrong # args: should be "string first needleString haystackString ?startIndex?"}}
   237         -test stringComp-4.4 {string first} {
   238         -    proc foo {} {string first bq abcdefgbcefgbqrs}
   239         -    foo
   240         -} 12
   241         -test stringComp-4.5 {string first} {
   242         -    proc foo {} {string fir bcd abcdefgbcefgbqrs}
   243         -    foo
   244         -} 1
   245         -test stringComp-4.6 {string first} {
   246         -    proc foo {} {string f b abcdefgbcefgbqrs}
   247         -    foo
   248         -} 1
   249         -test stringComp-4.7 {string first} {
   250         -    proc foo {} {string first xxx x123xx345xxx789xxx012}
   251         -    foo
   252         -} 9
   253         -test stringComp-4.8 {string first} {
   254         -    proc foo {} {string first "" x123xx345xxx789xxx012}
   255         -    foo
   256         -} -1
   257         -test stringComp-4.9 {string first, unicode} {
   258         -    proc foo {} {string first x abc\u7266x}
   259         -    foo
   260         -} 4
   261         -test stringComp-4.10 {string first, unicode} {
   262         -    proc foo {} {string first \u7266 abc\u7266x}
   263         -    foo
   264         -} 3
   265         -test stringComp-4.11 {string first, start index} {
   266         -    proc foo {} {string first \u7266 abc\u7266x 3}
   267         -    foo
   268         -} 3
   269         -test stringComp-4.12 {string first, start index} {
   270         -    proc foo {} {string first \u7266 abc\u7266x 4}
   271         -    foo
   272         -} -1
   273         -test stringComp-4.13 {string first, start index} {
   274         -    proc foo {} {string first \u7266 abc\u7266x end-2}
   275         -    foo
   276         -} 3
   277         -test stringComp-4.14 {string first, negative start index} {
   278         -    proc foo {} {string first b abc -1}
   279         -    foo
   280         -} 1
   281         -
   282         -test stringComp-5.1 {string index} {
   283         -    proc foo {} {string index}
   284         -    list [catch {foo} msg] $msg
   285         -} {1 {wrong # args: should be "string index string charIndex"}}
   286         -test stringComp-5.2 {string index} {
   287         -    proc foo {} {string index a b c}
   288         -    list [catch {foo} msg] $msg
   289         -} {1 {wrong # args: should be "string index string charIndex"}}
   290         -test stringComp-5.3 {string index} {
   291         -    proc foo {} {string index abcde 0}
   292         -    foo
   293         -} a
   294         -test stringComp-5.4 {string index} {
   295         -    proc foo {} {string in abcde 4}
   296         -    foo
   297         -} e
   298         -test stringComp-5.5 {string index} {
   299         -    proc foo {} {string index abcde 5}
   300         -    foo
   301         -} {}
   302         -test stringComp-5.6 {string index} {
   303         -    proc foo {} {string index abcde -10}
   304         -    list [catch {foo} msg] $msg
   305         -} {0 {}}
   306         -test stringComp-5.7 {string index} {
   307         -    proc foo {} {string index a xyz}
   308         -    list [catch {foo} msg] $msg
   309         -} {1 {bad index "xyz": must be integer?[+-]integer? or end?[+-]integer?}}
   310         -test stringComp-5.8 {string index} {
   311         -    proc foo {} {string index abc end}
   312         -    foo
   313         -} c
   314         -test stringComp-5.9 {string index} {
   315         -    proc foo {} {string index abc end-1}
   316         -    foo
   317         -} b
   318         -test stringComp-5.10 {string index, unicode} {
   319         -    proc foo {} {string index abc\u7266d 4}
   320         -    foo
   321         -} d
   322         -test stringComp-5.11 {string index, unicode} {
   323         -    proc foo {} {string index abc\u7266d 3}
   324         -    foo
   325         -} \u7266
   326         -test stringComp-5.12 {string index, unicode over char length, under byte length} {
   327         -    proc foo {} {string index \334\374\334\374 6}
   328         -    foo
   329         -} {}
   330         -test stringComp-5.13 {string index, bytearray object} {
   331         -    proc foo {} {string index [binary format a5 fuz] 0}
   332         -    foo
   333         -} f
   334         -test stringComp-5.14 {string index, bytearray object} {
   335         -    proc foo {} {string index [binary format I* {0x50515253 0x52}] 3}
   336         -    foo
   337         -} S
   338         -test stringComp-5.15 {string index, bytearray object} {
   339         -    proc foo {} {
   340         -	set b [binary format I* {0x50515253 0x52}]
   341         -	set i1 [string index $b end-6]
   342         -	set i2 [string index $b 1]
   343         -	string compare $i1 $i2
   344         -    }
   345         -    foo
   346         -} 0
   347         -test stringComp-5.16 {string index, bytearray object with string obj shimmering} {
   348         -    proc foo {} {
   349         -	set str "0123456789\x00 abcdedfghi"
   350         -	binary scan $str H* dump
   351         -	string compare [string index $str 10] \x00
   352         -    }
   353         -    foo
   354         -} 0
   355         -test stringComp-5.17 {string index, bad integer} -body {
   356         -    proc foo {} {string index "abc" 0o8}
   357         -    list [catch {foo} msg] $msg
   358         -} -match glob -result {1 {*}}
   359         -test stringComp-5.18 {string index, bad integer} -body {
   360         -    proc foo {} {string index "abc" end-0o0289}
   361         -    list [catch {foo} msg] $msg
   362         -} -match glob -result {1 {*}}
   363         -test stringComp-5.19 {string index, bytearray object out of bounds} {
   364         -    proc foo {} {string index [binary format I* {0x50515253 0x52}] -1}
   365         -    foo
   366         -} {}
   367         -test stringComp-5.20 {string index, bytearray object out of bounds} {
   368         -    proc foo {} {string index [binary format I* {0x50515253 0x52}] 20}
   369         -    foo
   370         -} {}
   371         -
   372         -
   373         -proc largest_int {} {
   374         -    # This will give us what the largest valid int on this machine is,
   375         -    # so we can test for overflow properly below on >32 bit systems
   376         -    set int 1
   377         -    set exp 7; # assume we get at least 8 bits
   378         -    while {$int > 0} { set int [expr {1 << [incr exp]}] }
   379         -    return [expr {$int-1}]
   380         -}
   381         -
   382         -## string is
   383         -## not yet bc
   384         -
   385         -catch {rename largest_int {}}
   386         -
   387         -## string last
   388         -## not yet bc
   389         -
   390         -## string length
   391         -## not yet bc
   392         -test stringComp-8.1 {string bytelength} {
   393         -    proc foo {} {string bytelength}
   394         -    list [catch {foo} msg] $msg
   395         -} {1 {wrong # args: should be "string bytelength string"}}
   396         -test stringComp-8.2 {string bytelength} {
   397         -    proc foo {} {string bytelength a b}
   398         -    list [catch {foo} msg] $msg
   399         -} {1 {wrong # args: should be "string bytelength string"}}
   400         -test stringComp-8.3 {string bytelength} {
   401         -    proc foo {} {string bytelength "\u00c7"}
   402         -    foo
   403         -} 2
   404         -test stringComp-8.4 {string bytelength} {
   405         -    proc foo {} {string b ""}
   406         -    foo
   407         -} 0
   408         -
   409         -## string length
   410         -##
   411         -test stringComp-9.1 {string length} {
   412         -    proc foo {} {string length}
   413         -    list [catch {foo} msg] $msg
   414         -} {1 {wrong # args: should be "string length string"}}
   415         -test stringComp-9.2 {string length} {
   416         -    proc foo {} {string length a b}
   417         -    list [catch {foo} msg] $msg
   418         -} {1 {wrong # args: should be "string length string"}}
   419         -test stringComp-9.3 {string length} {
   420         -    proc foo {} {string length "a little string"}
   421         -    foo
   422         -} 15
   423         -test stringComp-9.4 {string length} {
   424         -    proc foo {} {string le ""}
   425         -    foo
   426         -} 0
   427         -test stringComp-9.5 {string length, unicode} {
   428         -    proc foo {} {string le "abcd\u7266"}
   429         -    foo
   430         -} 5
   431         -test stringComp-9.6 {string length, bytearray object} {
   432         -    proc foo {} {string length [binary format a5 foo]}
   433         -    foo
   434         -} 5
   435         -test stringComp-9.7 {string length, bytearray object} {
   436         -    proc foo {} {string length [binary format I* {0x50515253 0x52}]}
   437         -    foo
   438         -} 8
   439         -
   440         -## string map
   441         -## not yet bc
   442         -
   443         -## string match
   444         -##
   445         -test stringComp-11.1 {string match, too few args} {
   446         -    proc foo {} {string match a}
   447         -    list [catch {foo} msg] $msg
   448         -} {1 {wrong # args: should be "string match ?-nocase? pattern string"}}
   449         -test stringComp-11.2 {string match, too many args} {
   450         -    proc foo {} {string match a b c d}
   451         -    list [catch {foo} msg] $msg
   452         -} {1 {wrong # args: should be "string match ?-nocase? pattern string"}}
   453         -test stringComp-11.3 {string match} {
   454         -    proc foo {} {string match abc abc}
   455         -    foo
   456         -} 1
   457         -test stringComp-11.4 {string match} {
   458         -    proc foo {} {string mat abc abd}
   459         -    foo
   460         -} 0
   461         -test stringComp-11.5 {string match} {
   462         -    proc foo {} {string match ab*c abc}
   463         -    foo
   464         -} 1
   465         -test stringComp-11.6 {string match} {
   466         -    proc foo {} {string match ab**c abc}
   467         -    foo
   468         -} 1
   469         -test stringComp-11.7 {string match} {
   470         -    proc foo {} {string match ab* abcdef}
   471         -    foo
   472         -} 1
   473         -test stringComp-11.8 {string match} {
   474         -    proc foo {} {string match *c abc}
   475         -    foo
   476         -} 1
   477         -test stringComp-11.9 {string match} {
   478         -    proc foo {} {string match *3*6*9 0123456789}
   479         -    foo
   480         -} 1
   481         -test stringComp-11.10 {string match} {
   482         -    proc foo {} {string match *3*6*9 01234567890}
   483         -    foo
   484         -} 0
   485         -test stringComp-11.11 {string match} {
   486         -    proc foo {} {string match a?c abc}
   487         -    foo
   488         -} 1
   489         -test stringComp-11.12 {string match} {
   490         -    proc foo {} {string match a??c abc}
   491         -    foo
   492         -} 0
   493         -test stringComp-11.13 {string match} {
   494         -    proc foo {} {string match ?1??4???8? 0123456789}
   495         -    foo
   496         -} 1
   497         -test stringComp-11.14 {string match} {
   498         -    proc foo {} {string match {[abc]bc} abc}
   499         -    foo
   500         -} 1
   501         -test stringComp-11.15 {string match} {
   502         -    proc foo {} {string match {a[abc]c} abc}
   503         -    foo
   504         -} 1
   505         -test stringComp-11.16 {string match} {
   506         -    proc foo {} {string match {a[xyz]c} abc}
   507         -    foo
   508         -} 0
   509         -test stringComp-11.17 {string match} {
   510         -    proc foo {} {string match {12[2-7]45} 12345}
   511         -    foo
   512         -} 1
   513         -test stringComp-11.18 {string match} {
   514         -    proc foo {} {string match {12[ab2-4cd]45} 12345}
   515         -    foo
   516         -} 1
   517         -test stringComp-11.19 {string match} {
   518         -    proc foo {} {string match {12[ab2-4cd]45} 12b45}
   519         -    foo
   520         -} 1
   521         -test stringComp-11.20 {string match} {
   522         -    proc foo {} {string match {12[ab2-4cd]45} 12d45}
   523         -    foo
   524         -} 1
   525         -test stringComp-11.21 {string match} {
   526         -    proc foo {} {string match {12[ab2-4cd]45} 12145}
   527         -    foo
   528         -} 0
   529         -test stringComp-11.22 {string match} {
   530         -    proc foo {} {string match {12[ab2-4cd]45} 12545}
   531         -    foo
   532         -} 0
   533         -test stringComp-11.23 {string match} {
   534         -    proc foo {} {string match {a\*b} a*b}
   535         -    foo
   536         -} 1
   537         -test stringComp-11.24 {string match} {
   538         -    proc foo {} {string match {a\*b} ab}
   539         -    foo
   540         -} 0
   541         -test stringComp-11.25 {string match} {
   542         -    proc foo {} {string match {a\*\?\[\]\\\x} "a*?\[\]\\x"}
   543         -    foo
   544         -} 1
   545         -test stringComp-11.26 {string match} {
   546         -    proc foo {} {string match ** ""}
   547         -    foo
   548         -} 1
   549         -test stringComp-11.27 {string match} {
   550         -    proc foo {} {string match *. ""}
   551         -    foo
   552         -} 0
   553         -test stringComp-11.28 {string match} {
   554         -    proc foo {} {string match "" ""}
   555         -    foo
   556         -} 1
   557         -test stringComp-11.29 {string match} {
   558         -    proc foo {} {string match \[a a}
   559         -    foo
   560         -} 1
   561         -test stringComp-11.30 {string match, bad args} {
   562         -    proc foo {} {string match - b c}
   563         -    list [catch {foo} msg] $msg
   564         -} {1 {bad option "-": must be -nocase}}
   565         -test stringComp-11.31 {string match case} {
   566         -    proc foo {} {string match a A}
   567         -    foo
   568         -} 0
   569         -test stringComp-11.32 {string match nocase} {
   570         -    proc foo {} {string match -n a A}
   571         -    foo
   572         -} 1
   573         -test stringComp-11.33 {string match nocase} {
   574         -    proc foo {} {string match -nocase a\334 A\374}
   575         -    foo
   576         -} 1
   577         -test stringComp-11.34 {string match nocase} {
   578         -    proc foo {} {string match -nocase a*f ABCDEf}
   579         -    foo
   580         -} 1
   581         -test stringComp-11.35 {string match case, false hope} {
   582         -    # This is true because '_' lies between the A-Z and a-z ranges
   583         -    proc foo {} {string match {[A-z]} _}
   584         -    foo
   585         -} 1
   586         -test stringComp-11.36 {string match nocase range} {
   587         -    # This is false because although '_' lies between the A-Z and a-z ranges,
   588         -    # we lower case the end points before checking the ranges.
   589         -    proc foo {} {string match -nocase {[A-z]} _}
   590         -    foo
   591         -} 0
   592         -test stringComp-11.37 {string match nocase} {
   593         -    proc foo {} {string match -nocase {[A-fh-Z]} g}
   594         -    foo
   595         -} 0
   596         -test stringComp-11.38 {string match case, reverse range} {
   597         -    proc foo {} {string match {[A-fh-Z]} g}
   598         -    foo
   599         -} 1
   600         -test stringComp-11.39 {string match, *\ case} {
   601         -    proc foo {} {string match {*\abc} abc}
   602         -    foo
   603         -} 1
   604         -test stringComp-11.40 {string match, *special case} {
   605         -    proc foo {} {string match {*[ab]} abc}
   606         -    foo
   607         -} 0
   608         -test stringComp-11.41 {string match, *special case} {
   609         -    proc foo {} {string match {*[ab]*} abc}
   610         -    foo
   611         -} 1
   612         -test stringComp-11.42 {string match, *special case} {
   613         -    proc foo {} {string match "*\\" "\\"}
   614         -    foo
   615         -} 0
   616         -test stringComp-11.43 {string match, *special case} {
   617         -    proc foo {} {string match "*\\\\" "\\"}
   618         -    foo
   619         -} 1
   620         -test stringComp-11.44 {string match, *special case} {
   621         -    proc foo {} {string match "*???" "12345"}
   622         -    foo
   623         -} 1
   624         -test stringComp-11.45 {string match, *special case} {
   625         -    proc foo {} {string match "*???" "12"}
   626         -    foo
   627         -} 0
   628         -test stringComp-11.46 {string match, *special case} {
   629         -    proc foo {} {string match "*\\*" "abc*"}
   630         -    foo
   631         -} 1
   632         -test stringComp-11.47 {string match, *special case} {
   633         -    proc foo {} {string match "*\\*" "*"}
   634         -    foo
   635         -} 1
   636         -test stringComp-11.48 {string match, *special case} {
   637         -    proc foo {} {string match "*\\*" "*abc"}
   638         -    foo
   639         -} 0
   640         -test stringComp-11.49 {string match, *special case} {
   641         -    proc foo {} {string match "?\\*" "a*"}
   642         -    foo
   643         -} 1
   644         -test stringComp-11.50 {string match, *special case} {
   645         -    proc foo {} {string match "\\" "\\"}
   646         -    foo
   647         -} 0
   648         -test stringComp-11.51 {string match; *, -nocase and UTF-8} {
   649         -    proc foo {} {string match -nocase [binary format I 717316707] \
   650         -	    [binary format I 2028036707]}
   651         -    foo
   652         -} 1
   653         -test stringComp-11.52 {string match, null char in string} {
   654         -    proc foo {} {
   655         -	set ptn "*abc*"
   656         -	foreach elem [list "\[email protected]" "@abc" "\[email protected]\u0000" "blahabcblah"] {
   657         -	    lappend out [string match $ptn $elem]
   658         -	}
   659         -	set out
   660         -    }
   661         -    foo
   662         -} {1 1 1 1}
   663         -test stringComp-11.53 {string match, null char in pattern} {
   664         -    proc foo {} {
   665         -	set out ""
   666         -	foreach {ptn elem} [list \
   667         -		"*\u0000abc\u0000"  "\u0000abc\u0000" \
   668         -		"*\u0000abc\u0000"  "\u0000abc\u0000ef" \
   669         -		"*\u0000abc\u0000*" "\u0000abc\u0000ef" \
   670         -		"*\u0000abc\u0000"  "@\u0000abc\u0000ef" \
   671         -		"*\u0000abc\u0000*"  "@\u0000abc\u0000ef" \
   672         -		] {
   673         -	    lappend out [string match $ptn $elem]
   674         -	}
   675         -	set out
   676         -    }
   677         -    foo
   678         -} {1 0 1 0 1}
   679         -test stringComp-11.54 {string match, failure} {
   680         -    proc foo {} {
   681         -	set longString ""
   682         -	for {set i 0} {$i < 10} {incr i} {
   683         -	    append longString "abcdefghijklmnopqrstuvwxy\u0000z01234567890123"
   684         -	}
   685         -	list [string match *cba* $longString] \
   686         -		[string match *a*l*\u0000* $longString] \
   687         -		[string match *a*l*\u0000*123 $longString] \
   688         -		[string match *a*l*\u0000*123* $longString] \
   689         -		[string match *a*l*\u0000*cba* $longString] \
   690         -		[string match *===* $longString]
   691         -    }
   692         -    foo
   693         -} {0 1 1 1 0 0}
   694         -
   695         -## string range
   696         -test stringComp-12.1 {Bug 3588366: end-offsets before start} {
   697         -    apply {s {
   698         -	string range $s 0 end-5
   699         -    }} 12345
   700         -} {}
   701         -
   702         -## string repeat
   703         -## not yet bc
   704         -
   705         -## string replace
   706         -test stringComp-14.1 {Bug 82e7f67325} {
   707         -    apply {x {
   708         -	set a [join $x {}]
   709         -	lappend b [string length [string replace ___! 0 2 $a]]
   710         -	lappend b [string length [string replace ___! 0 2 $a[unset a]]]
   711         -    }} {a b}
   712         -} {3 3}
   713         -test stringComp-14.2 {Bug 82e7f67325} memory {
   714         -    # As in stringComp-14.1, but make sure we don't retain too many refs
   715         -    leaktest {
   716         -	apply {x {
   717         -	    set a [join $x {}]
   718         -	    lappend b [string length [string replace ___! 0 2 $a]]
   719         -	    lappend b [string length [string replace ___! 0 2 $a[unset a]]]
   720         -	}} {a b}
   721         -    }
   722         -} {0}
   723         -test stringComp-14.3 {Bug 0dca3bfa8f} {
   724         -    apply {arg {
   725         -	set argCopy $arg
   726         -	set arg [string replace $arg 1 2 aa]
   727         -	# Crashes in comparison before fix
   728         -	expr {$arg ne $argCopy}
   729         -    }} abcde
   730         -} 1
   731         -test stringComp-14.4 {Bug 1af8de570511} {
   732         -    apply {{x y} {
   733         -	# Generate an unshared string value
   734         -	set val ""
   735         -	for { set i 0 } { $i < $x } { incr i } {
   736         -	    set val [format "0%s" $val]
   737         -	}
   738         -	string replace $val[unset val] 1 1 $y
   739         -    }} 4 x
   740         -} 0x00
   741         -test stringComp-14.5 {} {
   742         -    string length [string replace [string repeat a\u00fe 2] 3 end {}]
   743         -} 3
   744         -
   745         -## string tolower
   746         -## not yet bc
   747         -
   748         -## string toupper
   749         -## not yet bc
   750         -
   751         -## string totitle
   752         -## not yet bc
   753         -
   754         -## string trim*
   755         -## not yet bc
   756         -
   757         -## string word*
   758         -## not yet bc
   759         -
   760         -## string cat
   761         -test stringComp-29.1 {string cat, no arg} {
   762         -    proc foo {} {string cat}
   763         -    foo
   764         -} ""
   765         -test stringComp-29.2 {string cat, single arg} {
   766         -    proc foo {} {
   767         -	set x FOO
   768         -	string compare $x [string cat $x]
   769         -    }
   770         -    foo
   771         -} 0
   772         -test stringComp-29.3 {string cat, two args} {
   773         -    proc foo {} {
   774         -	set x FOO
   775         -	string compare $x$x [string cat $x $x]
   776         -    }
   777         -    foo
   778         -} 0
   779         -test stringComp-29.4 {string cat, many args} {
   780         -    proc foo {} {
   781         -	set x FOO
   782         -	set n 260
   783         -	set xx [string repeat $x $n]
   784         -	set vv [string repeat {$x} $n]
   785         -	set vvs [string repeat {$x } $n]
   786         -	set r1 [string compare $xx [subst $vv]]
   787         -	set r2 [string compare $xx [eval "string cat $vvs"]]
   788         -	list $r1 $r2
   789         -    }
   790         -    foo
   791         -} {0 0}
   792         -
   793         -
   794         -# cleanup
   795         -catch {rename foo {}}
   796         -::tcltest::cleanupTests
   797         -return
   798         -
   799         -# Local Variables:
   800         -# mode: tcl
   801         -# End: