Skip to content

Commit 1b54546

Browse files
author
jan.nijtmans
committed
Merge 8.6
2 parents ab3a945 + b14faba commit 1b54546

File tree

3 files changed

+54
-50
lines changed

3 files changed

+54
-50
lines changed

tests-perf/test-performance.tcl

+3-3
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ proc _test_run {args} {
137137
set args [lrange $args 1 end]
138138
} else {
139139
if {[llength $args] <= 2} {
140-
return -code error "value expected for option $o"
140+
return -code error "value expected for option $o"
141141
}
142142
set _($o) [lindex $args 1]
143143
set args [lrange $args 2 end]
@@ -169,7 +169,7 @@ proc _test_run {args} {
169169
if {[regexp {^\s*(?:setup|cleanup)\s+} $_(c)]} {
170170
set _(c) [lindex $_(c) 1]
171171
if {$_(-uplevel)} {
172-
set _(c) [list uplevel 1 $_(c)]
172+
set _(c) [list uplevel 1 $_(c)]
173173
}
174174
{*}$_(outcmd) [if 1 $_(c)]
175175
continue
@@ -184,7 +184,7 @@ proc _test_run {args} {
184184
if {$_(-convert-result) ne ""} { set _(r) [if 1 $_(-convert-result)] }
185185
{*}$_(outcmd) $_(r)
186186
if {[llength $_(ittime)] > 1} { # decrement max-count
187-
lset _(ittime) 1 [expr {[lindex $_(ittime) 1] - 1}]
187+
lset _(ittime) 1 [expr {[lindex $_(ittime) 1] - 1}]
188188
}
189189
}
190190
{*}$_(outcmd) [set _(m) [timerate $_(c) {*}$_(ittime)]]

tests/parseOld.test

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# Commands covered: set (plus basic command syntax). Also tests the
2-
# procedures in the file tclOldParse.c. This set of tests is an old
3-
# one that predates the new parser in Tcl 8.1.
1+
# Commands covered: set (plus basic command syntax). This set
2+
# of tests is an old one that predates the parser in Tcl 8.1.
43
#
54
# This file contains a collection of tests for one or more of the Tcl
65
# built-in commands. Sourcing this file into Tcl runs the tests and
@@ -363,17 +362,17 @@ test parseOld-10.14 {syntax errors} {
363362
"eval \$x[format "%01000d" 0]("}}
364363
test parseOld-10.15 {syntax errors, missplaced braces} {
365364
catch {
366-
proc misplaced_end_brace {} {
367-
set what foo
368-
set when [expr ${what}size - [set off$what]}]
365+
proc misplaced_end_brace {} {
366+
set what foo
367+
set when [expr ${what}size - [set off$what]}]
369368
} msg
370369
set msg
371370
} {extra characters after close-brace}
372371
test parseOld-10.16 {syntax errors, missplaced braces} {
373372
catch {
374-
set a {
375-
set what foo
376-
set when [expr ${what}size - [set off$what]}]
373+
set a {
374+
set what foo
375+
set when [expr ${what}size - [set off$what]}]
377376
} msg
378377
set msg
379378
} {extra characters after close-brace}

tests/tcltests.tcl

+43-38
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ testConstraint debugpurify [
1515
&& [testConstraint debug]
1616
&& [testConstraint purify]
1717
}]
18+
testConstraint bigmem [expr {[
19+
info exists ::env(TCL_TESTCONSTRAINT_BIGMEM)]
20+
? !!$::env(TCL_TESTCONSTRAINT_BIGMEM)
21+
: 1
22+
}]
1823
testConstraint fcopy [llength [info commands fcopy]]
1924
testConstraint fileevent [llength [info commands fileevent]]
2025
testConstraint thread [expr {![catch {package require Thread 2.7-}]}]
@@ -70,47 +75,47 @@ namespace eval ::tcltests {
7075
# testnumargs "lappend" "varName" "?value ...?"
7176
proc testnumargs {cmd {fixed {}} {optional {}} args} {
7277
variable count
73-
set minargs [llength $fixed]
74-
set maxargs [expr {$minargs + [llength $optional]}]
75-
if {[regexp {\.\.\.\??$} [lindex $optional end]]} {
76-
unset maxargs; # No upper limit on num of args
77-
}
78-
set message "wrong # args: should be \"$cmd"
79-
if {[llength $fixed]} {
80-
append message " $fixed"
81-
}
82-
if {[llength $optional]} {
83-
append message " $optional"
84-
}
85-
if {[llength $fixed] == 0 && [llength $optional] == 0} {
86-
append message " \""
87-
} else {
88-
append message "\""
89-
}
90-
set label [join $cmd -]
91-
if {$minargs > 0} {
92-
set arguments [lrepeat [expr {$minargs-1}] x]
93-
test $label-minargs-[incr count($label-minargs)] \
78+
set minargs [llength $fixed]
79+
set maxargs [expr {$minargs + [llength $optional]}]
80+
if {[regexp {\.\.\.\??$} [lindex $optional end]]} {
81+
unset maxargs; # No upper limit on num of args
82+
}
83+
set message "wrong # args: should be \"$cmd"
84+
if {[llength $fixed]} {
85+
append message " $fixed"
86+
}
87+
if {[llength $optional]} {
88+
append message " $optional"
89+
}
90+
if {[llength $fixed] == 0 && [llength $optional] == 0} {
91+
append message " \""
92+
} else {
93+
append message "\""
94+
}
95+
set label [join $cmd -]
96+
if {$minargs > 0} {
97+
set arguments [lrepeat [expr {$minargs-1}] x]
98+
test $label-minargs-[incr count($label-minargs)] \
9499
"$label no arguments" \
95-
-body "$cmd" \
96-
-result $message -returnCodes error \
97-
{*}$args
98-
if {$minargs > 1} {
99-
test $label-minargs-[incr count($label-minargs)] \
100+
-body "$cmd" \
101+
-result $message -returnCodes error \
102+
{*}$args
103+
if {$minargs > 1} {
104+
test $label-minargs-[incr count($label-minargs)] \
100105
"$label missing arguments" \
101-
-body "$cmd $arguments" \
102-
-result $message -returnCodes error \
103-
{*}$args
104-
}
105-
}
106-
if {[info exists maxargs]} {
107-
set arguments [lrepeat [expr {$maxargs+1}] x]
108-
test $label-maxargs-[incr count($label-maxargs)] \
106+
-body "$cmd $arguments" \
107+
-result $message -returnCodes error \
108+
{*}$args
109+
}
110+
}
111+
if {[info exists maxargs]} {
112+
set arguments [lrepeat [expr {$maxargs+1}] x]
113+
test $label-maxargs-[incr count($label-maxargs)] \
109114
"$label extra arguments" \
110-
-body "$cmd $arguments" \
111-
-result $message -returnCodes error \
112-
{*}$args
113-
}
115+
-body "$cmd $arguments" \
116+
-result $message -returnCodes error \
117+
{*}$args
118+
}
114119
}
115120

116121
init

0 commit comments

Comments
 (0)