Update tests.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
5f1ddd66d8
commit
07d2b941b5
|
@ -0,0 +1,33 @@
|
||||||
|
#
|
||||||
|
# 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 CSI_8BIT "\x9b"
|
||||||
|
|
||||||
|
tcsgrep_start
|
||||||
|
|
||||||
|
# Use Latin-1 charset, which supports 8-bit characters.
|
||||||
|
# Otherwise it will be converted into a 2-byte UTF-8 character.
|
||||||
|
fconfigure $spawn_id -encoding iso8859-1
|
||||||
|
|
||||||
|
send $CSI_8BIT
|
||||||
|
expect {
|
||||||
|
# ctlseqs does not recognize 8-bit control characters,
|
||||||
|
# but reading them should not break the program.
|
||||||
|
-ex "NOSEQ 1 \\x9b\n" {
|
||||||
|
pass "pass"
|
||||||
|
}
|
||||||
|
default {
|
||||||
|
puts $expect_out(buffer)
|
||||||
|
fail "fail"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tcsgrep_stop
|
|
@ -28,7 +28,7 @@ tcsgrep_start
|
||||||
for { set i 0 } { $i < [ llength $input ] } { incr i } {
|
for { set i 0 } { $i < [ llength $input ] } { incr i } {
|
||||||
set seq [ lindex $input $i ]
|
set seq [ lindex $input $i ]
|
||||||
set expected [ lindex $output $i ]
|
set expected [ lindex $output $i ]
|
||||||
send -- $seq
|
send $seq
|
||||||
expect {
|
expect {
|
||||||
-ex "$expected\n" {
|
-ex "$expected\n" {
|
||||||
pass "pass"
|
pass "pass"
|
||||||
|
|
|
@ -9,12 +9,15 @@
|
||||||
set tool ctlseqs
|
set tool ctlseqs
|
||||||
set timeout 2
|
set timeout 2
|
||||||
|
|
||||||
|
# Tests library behaviour when read buffer is full.
|
||||||
|
# Also tests whether buffer purging works.
|
||||||
|
|
||||||
set seq "${CSI}123;4567S"
|
set seq "${CSI}123;4567S"
|
||||||
set expected "NOMEM 10 ESC \[ 1 2 3 ; 4 5 6 7\nNOSEQ 1 S"
|
set expected "NOMEM 10 ESC \[ 1 2 3 ; 4 5 6 7\nNOSEQ 1 S"
|
||||||
|
|
||||||
tcsgrep_start limit=10 purge
|
tcsgrep_start limit=10 purge
|
||||||
|
|
||||||
send -- $seq
|
send $seq
|
||||||
expect {
|
expect {
|
||||||
-ex "$expected\n" {
|
-ex "$expected\n" {
|
||||||
pass "pass"
|
pass "pass"
|
||||||
|
|
|
@ -14,9 +14,11 @@ set nlen [ string length $n1 ]
|
||||||
|
|
||||||
tcsgrep_start verbose
|
tcsgrep_start verbose
|
||||||
|
|
||||||
send -- "$CSI"
|
send "$CSI"
|
||||||
expect {
|
expect {
|
||||||
-ex "PARTIAL 2 ESC \[\n" { }
|
-ex "PARTIAL 2 ESC \[\n" {
|
||||||
|
pass "pass"
|
||||||
|
}
|
||||||
default {
|
default {
|
||||||
puts $expect_out(buffer)
|
puts $expect_out(buffer)
|
||||||
fail "fail"
|
fail "fail"
|
||||||
|
@ -24,9 +26,11 @@ expect {
|
||||||
}
|
}
|
||||||
|
|
||||||
for { set i 0 } { $i < $nlen } { incr i } {
|
for { set i 0 } { $i < $nlen } { incr i } {
|
||||||
send -- [ string index $n1 $i ]
|
send [ string index $n1 $i ]
|
||||||
expect {
|
expect {
|
||||||
-ex "PARTIAL [ expr $i + 3 ] ESC \[ [ split [ string range $n1 0 $i ] {} ]\n" { }
|
-ex "PARTIAL [ expr $i + 3 ] ESC \[ [ split [ string range $n1 0 $i ] {} ]\n" {
|
||||||
|
pass "pass"
|
||||||
|
}
|
||||||
default {
|
default {
|
||||||
puts $expect_out(buffer)
|
puts $expect_out(buffer)
|
||||||
fail "fail"
|
fail "fail"
|
||||||
|
@ -34,7 +38,7 @@ for { set i 0 } { $i < $nlen } { incr i } {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
send -- "p"
|
send "p"
|
||||||
expect {
|
expect {
|
||||||
-ex "NOMATCH [ expr $nlen + 3 ] ESC \[ [ split $n1 {} ] p\n" {
|
-ex "NOMATCH [ expr $nlen + 3 ] ESC \[ [ split $n1 {} ] p\n" {
|
||||||
pass "pass"
|
pass "pass"
|
||||||
|
|
Loading…
Reference in New Issue