diff --git a/tests/ctlseqs/match.exp b/tests/ctlseqs/match.exp index 239c143..aedcf51 100644 --- a/tests/ctlseqs/match.exp +++ b/tests/ctlseqs/match.exp @@ -9,9 +9,9 @@ set tool ctlseqs set timeout 2 -set n1 [ expr int(rand()*5000) ] -set n2 [ expr int(rand()*5000) ] -set n3 [ expr int(rand()*5000) ] +set n1 [ random_int ] +set n2 [ random_int ] +set n3 [ random_int ] set input { } lappend input "$CSI$n1;${n2}H" diff --git a/tests/init.exp b/tests/init.exp index b3c1d1e..a047423 100644 --- a/tests/init.exp +++ b/tests/init.exp @@ -6,6 +6,11 @@ # this notice are preserved. This file is offered as-is, without any warranty. # +set ESC "\x1b" +set CSI "$ESC\[" +set DCS "${ESC}P" +set ST "$ESC\\" + proc tcsgrep_start args { global TCSGREP_BIN set run_cmd [ list $TCSGREP_BIN "-t500" ] @@ -38,7 +43,7 @@ proc tcsgrep_stop { } { } } -set ESC "\x1b" -set CSI "$ESC\[" -set DCS "${ESC}P" -set ST "$ESC\\" +proc random_int { } { + set num [ exec od -An -td -N4 /dev/urandom ] + return [ expr abs(int($num)) ] +}