49 lines
1016 B
Plaintext
49 lines
1016 B
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" { }
|
|
default {
|
|
puts $expect_out(buffer)
|
|
fail "fail"
|
|
}
|
|
}
|
|
|
|
for { set i 0 } { $i < $nlen } { incr i } {
|
|
send -- [ string index $n1 $i ]
|
|
expect {
|
|
-ex "PARTIAL [ expr $i + 3 ] ESC \[ [ split [ string range $n1 0 $i ] {} ]\n" { }
|
|
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
|