ctlseqs/tests/ctlseqs/partial.exp

53 lines
1.0 KiB
Plaintext
Raw Normal View History

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.
#
2021-02-01 12:49:18 +00:00
set tool ctlseqs
set timeout 2
set n1 [ random_int ]
set nlen [ string length $n1 ]
tcsgrep_start verbose
2021-02-02 07:23:50 +00:00
send "$CSI"
2021-02-01 12:49:18 +00:00
expect {
2021-02-02 07:23:50 +00:00
-ex "PARTIAL 2 ESC \[\n" {
pass "pass"
}
2021-02-01 12:49:18 +00:00
default {
puts $expect_out(buffer)
fail "fail"
}
}
for { set i 0 } { $i < $nlen } { incr i } {
2021-02-02 07:23:50 +00:00
send [ string index $n1 $i ]
2021-02-01 12:49:18 +00:00
expect {
2021-02-02 07:23:50 +00:00
-ex "PARTIAL [ expr $i + 3 ] ESC \[ [ split [ string range $n1 0 $i ] {} ]\n" {
pass "pass"
}
2021-02-01 12:49:18 +00:00
default {
puts $expect_out(buffer)
fail "fail"
}
}
}
2021-02-02 07:23:50 +00:00
send "p"
2021-02-01 12:49:18 +00:00
expect {
2021-02-01 18:48:15 +00:00
-ex "NOMATCH [ expr $nlen + 3 ] ESC \[ [ split $n1 {} ] p\n" {
pass "pass"
}
2021-02-01 12:49:18 +00:00
default {
puts $expect_out(buffer)
fail "fail"
}
}
tcsgrep_stop