@@ -193,15 +193,17 @@ test regexp-5.5 {exercise cache of compiled expressions} {
193193 regexp .*e xe
194194} 1
195195
196- test regexp-6.1 {regexp errors} {
196+ test regexp-6.1 {regexp errors} -body {
197197 list [catch {regexp a} msg] $msg
198- } {1 {wrong # args: should be "regexp ?-switch ...? exp string ?matchVar? ?subMatchVar ...?"}}
199- test regexp-6.2 {regexp errors} {
198+ } -result {1 {wrong # args: should be "regexp ?-option ...? exp string ?matchVar? ?subMatchVar ...?"}}
199+
200+ test regexp-6.2 {regexp errors} -body {
200201 list [catch {regexp -nocase a} msg] $msg
201- } {1 {wrong # args: should be "regexp ?-switch ...? exp string ?matchVar? ?subMatchVar ...?"}}
202+ } -result {1 {wrong # args: should be "regexp ?-option ...? exp string ?matchVar? ?subMatchVar ...?"}}
203+
202204test regexp-6.3 {regexp errors} -constraints jim -body {
203205 list [catch {regexp -gorp a} msg] $msg
204- } -result {1 {bad switch "-gorp": must be --, -all, -expanded, -indices, -inline, -line, -nocase, or -start}}
206+ } -result {1 {bad option "-gorp": must be --, -all, -expanded, -indices, -inline, -line, -nocase, or -start}}
205207test regexp-6.4 {regexp errors} {
206208 catch {regexp a( b} msg
207209} 1
@@ -219,13 +221,14 @@ test regexp-6.8 {regexp errors} jim {
219221 set f1 44
220222 list [catch {regexp abc abc f1(f2)} msg] $msg
221223} {1 {can't set "f1(f2)": variable isn't array}}
222- test regexp-6.9 {regexp errors, -start bad int check} {
224+
225+ test regexp-6.9 {regexp errors, -start bad int check} -body {
223226 list [catch {regexp -start bogus {^$} {}} msg] $msg
224- } {1 {bad index "bogus": must be intexpr or end?[+-]intexpr?}}
225- test regexp-6.10 {regexp errors, -start too few args} {
226- list [catch {regexp -all -start} msg] $msg
227- } {1 {wrong # args: should be "regexp ?-switch ...? exp string ?matchVar? ?subMatchVar ...?"}}
227+ } -match glob -result {1 {bad index "bogus": must be int* or end\?\[+-\]int*\?}}
228228
229+ test regexp-6.10 {regexp errors, -start too few args} -body {
230+ list [catch {regexp -all -start} msg] $msg
231+ } -result {1 {wrong # args: should be "regexp ?-option ...? exp string ?matchVar? ?subMatchVar ...?"}}
229232
230233test regexp-7.1 {basic regsub operation} {
231234 list [regsub aa+ xaxaaaxaa 111&222 foo] $foo
@@ -355,19 +358,24 @@ test regexp-10.3 {newline sensitivity in regsub} {
355358
356359test regexp-11.1 {regsub errors} {
357360 list [catch {regsub a b} msg] $msg
358- } {1 {wrong # args: should be "regsub ?-switch ...? exp string subSpec ?varName?"}}
361+ } {1 {wrong # args: should be "regsub ?-option ...? exp string subSpec ?varName?"}}
359362test regexp-11.2 {regsub errors} {
360363 list [catch {regsub -nocase a b} msg] $msg
361- } {1 {wrong # args: should be "regsub ?-switch ...? exp string subSpec ?varName?"}}
364+ } {1 {wrong # args: should be "regsub ?-option ...? exp string subSpec ?varName?"}}
362365test regexp-11.3 {regsub errors} {
363366 list [catch {regsub -nocase -all a b} msg] $msg
364- } {1 {wrong # args: should be "regsub ?-switch ...? exp string subSpec ?varName?"}}
367+ } {1 {wrong # args: should be "regsub ?-option ...? exp string subSpec ?varName?"}}
365368test regexp-11.4 {regsub errors} {
366369 list [catch {regsub a b c d e f} msg] $msg
367- } {1 {wrong # args: should be "regsub ?-switch ...? exp string subSpec ?varName?"}}
370+ } {1 {wrong # args: should be "regsub ?-option ...? exp string subSpec ?varName?"}}
368371test regexp-11.5 {regsub errors} -constraints jim -body {
369372 list [catch {regsub -gorp a b c} msg] $msg
370- } -result {1 {bad switch "-gorp": must be --, -all, -command, -expanded, -line, -nocase, or -start}}
373+ } -result {1 {bad option "-gorp": must be --, -all, -command, -expanded, -line, -nocase, or -start}}
374+
375+ test regexp-11.5 {regsub errors} -constraints tcl -body {
376+ list [catch {regsub -gorp a b c} msg] $msg
377+ } -result {1 {bad option "-gorp": must be -all, -command, -expanded, -line, -linestop, -lineanchor, -nocase, -start, or --}}
378+
371379test regexp-11.6 {regsub errors} {
372380 catch {regsub -nocase a( b c d} msg
373381} 1
@@ -376,9 +384,11 @@ test regexp-11.7 {regsub errors} jim {
376384 set f1 44
377385 list [catch {regsub -nocase aaa aaa xxx f1(f2)} msg] $msg
378386} {1 {can't set "f1(f2)": variable isn't array}}
379- test regexp-11.8 {regsub errors, -start bad int check} {
387+
388+ test regexp-11.8 {regsub errors, -start bad int check} -body {
380389 list [catch {regsub -start bogus pattern string rep var} msg] $msg
381- } {1 {bad index "bogus": must be intexpr or end?[+-]intexpr?}}
390+ } -match glob -result {1 {bad index "bogus": must be int* or end\?\[+-\]int*\?}}
391+
382392test regexp-11.9 {regsub without final variable name returns value} {
383393 regsub b abaca X
384394} {aXaca}
@@ -394,7 +404,7 @@ test regexp-11.12 {regsub without final variable name returns value} {
394404} {a,bcd,c,ea,bcfd,cf,e}
395405test regexp-11.13 {regsub errors, -start too few args} {
396406 list [catch {regsub -all -nocase -nocase -start} msg] $msg
397- } {1 {wrong # args: should be "regsub ?-switch ...? exp string subSpec ?varName?"}}
407+ } {1 {wrong # args: should be "regsub ?-option ...? exp string subSpec ?varName?"}}
398408
399409
400410# This test crashes on the Mac unless you increase the Stack Space to about 1
0 commit comments