Posted to tcl by sebres at Tue Mar 16 12:56:37 GMT 2021view raw
- test compExpr-8.2 {Compile and execute compare operator (no numeric conversion)} -setup {
- interp create li
- interp eval li {
- set a [string repeat 1234567890 10000]
- set a "$a-Z-$a"
- set b ""
- set c "c"
- }
- # restrict evaluation time to 3 seconds (if no regression it takes few microseconds):
- interp limit li time -granularity 1 -seconds [expr {[clock seconds]+3}]
- } -body {
- interp eval li {list \
- [expr {$a=="" && $a!="" || $a=="" && $a!="" || $a<"" && $a>"" || $a<="" && $a>=""}] \
- [expr {""==$a && ""!=$a || ""==$a && ""!=$a || ""<$a && "">$a || ""<=$a && "">=$a}] \
- [expr {$a=="a" && $a!="a" || $a=="a" && $a!="a" || $a<"a" && $a>"a" || $a<="a" && $a>="a"}] \
- [expr {"a"==$a && "a"!=$a || "a"==$a && "a"!=$a || "a"<$a && "a">$a || "a"<=$a && "a">=$a}] \
- [expr {$a==$b && $a!=$b || $a==$b && $a!=$b || $a<$b && $a>$b || $a<=$b && $a>=$b}] \
- [expr {$a==$c && $a!=$c || $a==$c && $a!=$c || $a<$c && $a>$c || $a<=$c && $a>=$c}]
- }
- } -result {0 0 0 0 0 0} -cleanup {
- interp delete li
- }