2021-01-19 12:08:52 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2021 CismonX <admin@cismon.net>
|
|
|
|
#
|
|
|
|
# Copying and distribution of this file, with or without modification, are
|
|
|
|
# permitted in any medium without royalty, provided the copyright notice and
|
|
|
|
# this notice are preserved. This file is offered as-is, without any warranty.
|
|
|
|
#
|
|
|
|
|
|
|
|
set tool ctlseqs
|
|
|
|
set timeout 2
|
|
|
|
|
2021-01-20 19:42:21 +00:00
|
|
|
set n1 [ random_int ]
|
|
|
|
set n2 [ random_int ]
|
|
|
|
set n3 [ random_int ]
|
2021-10-30 14:43:54 +00:00
|
|
|
set n1_len [ string length $n1 ]
|
2021-01-19 12:08:52 +00:00
|
|
|
|
2021-10-30 14:43:54 +00:00
|
|
|
set input [ list \
|
|
|
|
"$CSI$n1;${n2}H" \
|
|
|
|
"$DCS$n1;$n2|$n3$ST" \
|
|
|
|
"$CSI<?${n1}Z" \
|
|
|
|
]
|
2021-01-19 12:08:52 +00:00
|
|
|
|
2021-10-30 14:43:54 +00:00
|
|
|
set output [ list \
|
|
|
|
"OK CUP $n1 $n2" \
|
|
|
|
"OK DECUDK $n1 $n2 $n3" \
|
|
|
|
"NOMATCH [ expr { $n1_len + 5 } ] ESC \[ < ? [ split $n1 {} ] Z" \
|
|
|
|
]
|
2021-01-19 12:08:52 +00:00
|
|
|
|
|
|
|
tcsgrep_start
|
|
|
|
|
|
|
|
for { set i 0 } { $i < [ llength $input ] } { incr i } {
|
|
|
|
set seq [ lindex $input $i ]
|
|
|
|
set expected [ lindex $output $i ]
|
2021-02-02 07:23:50 +00:00
|
|
|
send $seq
|
2021-01-19 12:08:52 +00:00
|
|
|
expect {
|
|
|
|
-ex "$expected\n" {
|
2021-02-01 18:48:15 +00:00
|
|
|
pass "pass"
|
2021-01-19 12:08:52 +00:00
|
|
|
}
|
|
|
|
default {
|
|
|
|
puts $expect_out(buffer)
|
|
|
|
fail "fail"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tcsgrep_stop
|