@@ -37,12 +37,12 @@ test regexp-1.5 {basic regexp operation} {
3737test regexp-1.6 {basic regexp operation} regexp_are {
3838 list [catch {regexp {} abc} msg] $msg
3939} {0 1}
40- # test regexp-1.7 {regexp utf compliance} {
41- # # if not UTF-8 aware, result is "0 1"
42- # set foo "\u4e4eb q"
43- # regexp "\u4e4eb q" "a\u4e4eb qw\u5e4e\x4e wq" bar
44- # list [string compare $foo $bar] [regexp 4 $bar]
45- # } {0 0}
40+ test regexp-1.7 {regexp utf compliance} {
41+ # if not UTF-8 aware, result is "0 1"
42+ set foo "\u4e4eb q"
43+ regexp "\u4e4eb q" "a\u4e4eb qw\u5e4e\x4e wq" bar
44+ list [string compare $foo $bar] [regexp 4 $bar]
45+ } {0 0}
4646
4747
4848test regexp-2.1 {getting substrings back from regexp} {
@@ -201,9 +201,9 @@ test regexp-6.2 {regexp errors} -body {
201201 list [catch {regexp -nocase a} msg] $msg
202202} -result {1 {wrong # args: should be "regexp ?-option ...? exp string ?matchVar? ?subMatchVar ...?"}}
203203
204- test regexp-6.3 {regexp errors} -constraints jim - body {
204+ test regexp-6.3 {regexp errors} -body {
205205 list [catch {regexp -gorp a} msg] $msg
206- } -result {1 {bad option "-gorp": must be -all, -expanded, -indices, -inline, -line, -nocase, -start, or --}}
206+ } -result {1 {bad option "-gorp": must be -all, -expanded, -indices, -inline, -line, -lineanchor, -linestop, - nocase, -start, or --}}
207207
208208test regexp-6.4 {regexp errors} {
209209 catch {regexp a( b} msg
@@ -283,12 +283,12 @@ test regexp-7.16 {basic regsub operation} {
283283 set foo xxx
284284 list [regsub x "" y foo] $foo
285285} {0 {}}
286- # test regexp-7.17 {regsub utf compliance} {
287- # # if not UTF-8 aware, result is "0 1"
288- # set foo "xyz555ijka\u4e4ebpqr"
289- # regsub a\u4e4eb xyza\u4e4ebijka\u4e4ebpqr 555 bar
290- # list [string compare $foo $bar] [regexp 4 $bar]
291- # } {0 0}
286+ test regexp-7.17 {regsub utf compliance} {
287+ # if not UTF-8 aware, result is "0 1"
288+ set foo "xyz555ijka\u4e4ebpqr"
289+ regsub a\u4e4eb xyza\u4e4ebijka\u4e4ebpqr 555 bar
290+ list [string compare $foo $bar] [regexp 4 $bar]
291+ } {0 0}
292292
293293test regexp-8.1 {case conversion in regsub} {
294294 list [regsub -nocase a(a+) xaAAaAAay & foo] $foo
@@ -348,14 +348,14 @@ test regexp-10.3 {newline sensitivity in regsub} {
348348 set foo xxx
349349 list [regsub -line {^a.*b$} "dabc\naxyb\nxb" 123 foo] $foo
350350} "1 {dabc\n123\nxb}"
351- # test regexp-10.4 {partial newline sensitivity in regsub} {
352- # set foo xxx
353- # list [regsub -lineanchor {^a.*b$} "da\naxyb\nxb" 123 foo] $foo
354- # } "1 {da\n123}"
355- # test regexp-10.5 {inverse partial newline sensitivity in regsub} {
356- # set foo xxx
357- # list [regsub -linestop {a.*b} "da\nbaxyb\nxb" 123 foo] $foo
358- # } "1 {da\nb123\nxb}"
351+ test regexp-10.4 {partial newline sensitivity in regsub} {
352+ set foo xxx
353+ list [regsub -lineanchor {^a.*b$} "da\naxyb\nxb" 123 foo] $foo
354+ } "1 {da\n123}"
355+ test regexp-10.5 {inverse partial newline sensitivity in regsub} {
356+ set foo xxx
357+ list [regsub -linestop {a.*b} "da\nbaxyb\nxb" 123 foo] $foo
358+ } "1 {da\nb123\nxb}"
359359
360360test regexp-11.1 {regsub errors} {
361361 list [catch {regsub a b} msg] $msg
@@ -370,13 +370,9 @@ test regexp-11.4 {regsub errors} {
370370 list [catch {regsub a b c d e f} msg] $msg
371371} {1 {wrong # args: should be "regsub ?-option ...? exp string subSpec ?varName?"}}
372372
373- test regexp-11.5 {regsub errors} -constraints jim -body {
374- list [catch {regsub -gorp a b c} msg] $msg
375- } -result {1 {bad option "-gorp": must be -all, -command, -expanded, -line, -nocase, -start, or --}}
376-
377- test regexp-11.5 {regsub errors} -constraints tcl -body {
373+ test regexp-11.5 {regsub errors} -body {
378374 list [catch {regsub -gorp a b c} msg] $msg
379- } -result {1 {bad option "-gorp": must be -all, -command, -expanded, -line, -linestop , -lineanchor , -nocase, -start, or --}}
375+ } -result {1 {bad option "-gorp": must be -all, -command, -expanded, -line, -lineanchor , -linestop , -nocase, -start, or --}}
380376
381377test regexp-11.6 {regsub errors} {
382378 catch {regsub -nocase a( b c d} msg
@@ -605,14 +601,14 @@ test regexp-19.1 {regsub null replacement} {
605601 list $result [string length $result]
606602} "\0a\0hel\0a\0lo\0a\0 14"
607603
608- # test regexp-20.1 {regsub shared object shimmering} {
609- # # Bug #461322
610- # set a abcdefghijklmnopqurstuvwxyz
611- # set b $a
612- # set c abcdefghijklmnopqurstuvwxyz0123456789
613- # regsub $a $c $b d
614- # list $d [string length $d] [string bytelength $d]
615- # } [list abcdefghijklmnopqurstuvwxyz0123456789 37 37]
604+ test regexp-20.1 {regsub shared object shimmering} {
605+ # Bug #461322
606+ set a abcdefghijklmnopqurstuvwxyz
607+ set b $a
608+ set c abcdefghijklmnopqurstuvwxyz0123456789
609+ regsub $a $c $b d
610+ list $d [string length $d] [string bytelength $d]
611+ } [list abcdefghijklmnopqurstuvwxyz0123456789 37 37]
616612#test regexp-20.2 {regsub shared object shimmering with -about} {
617613# eval regexp -about abc
618614#} {0 {}}
@@ -653,9 +649,9 @@ test regexp-21.9 {regexp works with empty string offset} {
653649 regexp -start 3 -- \$ {123}
654650} {1}
655651
656- # test regexp-21.10 {multiple matches handle newlines} {
657- # regsub -all -lineanchor -- {^#[^\n]*\n} "#one\n#two\n#three\n" foo\n
658- # } "foo\nfoo\nfoo\n"
652+ test regexp-21.10 {multiple matches handle newlines} {
653+ regsub -all -lineanchor -- {^#[^\n]*\n} "#one\n#two\n#three\n" foo\n
654+ } "foo\nfoo\nfoo\n"
659655
660656test regexp-21.11 {multiple matches handle newlines} {
661657 regsub -all -line -- ^ "a\nb\nc" \#
0 commit comments