54 lines
1.1 KiB
Plaintext
54 lines
1.1 KiB
Plaintext
#
|
|
# 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
|
|
|
|
set n1 [ random_int ]
|
|
set nlen [ string length $n1 ]
|
|
|
|
tcsgrep_start verbose
|
|
|
|
send "$CSI"
|
|
expect {
|
|
-ex "PARTIAL 2 ESC \[\n" {
|
|
pass "pass"
|
|
}
|
|
default {
|
|
puts $expect_out(buffer)
|
|
fail "fail"
|
|
}
|
|
}
|
|
|
|
for { set i 0 } { $i < $nlen } { incr i } {
|
|
set substr [ string range $n1 0 $i ]
|
|
send [ string index $n1 $i ]
|
|
expect {
|
|
-ex "PARTIAL [ expr { $i + 3 } ] ESC \[ [ split $substr {} ]\n" {
|
|
pass "pass"
|
|
}
|
|
default {
|
|
puts $expect_out(buffer)
|
|
fail "fail"
|
|
}
|
|
}
|
|
}
|
|
|
|
send "p"
|
|
expect {
|
|
-ex "NOMATCH [ expr { $nlen + 3 } ] ESC \[ [ split $n1 {} ] p\n" {
|
|
pass "pass"
|
|
}
|
|
default {
|
|
puts $expect_out(buffer)
|
|
fail "fail"
|
|
}
|
|
}
|
|
|
|
tcsgrep_stop
|