Add tests.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
9f60546d0b
commit
5b9d919a17
|
@ -5,3 +5,24 @@
|
|||
# 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 seq "${CSI}123;4567S"
|
||||
set expected "NOMEM 10 ESC \[ 1 2 3 ; 4 5 6 7\nNOSEQ 1 S"
|
||||
|
||||
tcsgrep_start limit=10 purge
|
||||
|
||||
send -- $seq
|
||||
expect {
|
||||
-ex "$expected\n" {
|
||||
pass "OK"
|
||||
}
|
||||
default {
|
||||
puts $expect_out(buffer)
|
||||
fail "fail"
|
||||
}
|
||||
}
|
||||
|
||||
tcsgrep_stop
|
||||
|
|
|
@ -5,3 +5,42 @@
|
|||
# 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" { }
|
||||
default {
|
||||
puts $expect_out(buffer)
|
||||
fail "fail"
|
||||
}
|
||||
}
|
||||
|
||||
tcsgrep_stop
|
||||
|
|
|
@ -17,9 +17,10 @@ proc tcsgrep_start args {
|
|||
foreach arg $args {
|
||||
lappend run_cmd [
|
||||
switch -regexp -matchvar value -- $arg {
|
||||
verbose { lindex "-v" }
|
||||
purge { lindex "-p" }
|
||||
limit=(\\d+) { lindex "-l[lindex $value 1]" }
|
||||
verbose { lindex "-v" }
|
||||
purge { lindex "-p" }
|
||||
limit=(\\d+) { lindex "-l [ lindex $value 1 ]" }
|
||||
timeout=(\\d+) { lindex "-t [ lindex $value 1 ]" }
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue