diff options
author | Steve Bennett <steveb@workware.net.au> | 2025-08-09 21:10:48 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2025-08-13 08:05:25 +1000 |
commit | 6b1a99710f1f81a5918da053d60b2d6cef96a220 (patch) | |
tree | 48611e37ac17d5967aebe88602fa425bb92351ed | |
parent | 948296dc9648a793edf9de4429d9a8b4ab664d8c (diff) | |
download | jimtcl-6b1a99710f1f81a5918da053d60b2d6cef96a220.zip jimtcl-6b1a99710f1f81a5918da053d60b2d6cef96a220.tar.gz jimtcl-6b1a99710f1f81a5918da053d60b2d6cef96a220.tar.bz2 |
tests: interactive.test: fix for posix regex
If using POSIX regex instead of the builtin jim regex,
\r and \n character escapes are not supported.
Use literal \r and \n instead.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r-- | tests/interactive.test | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/interactive.test b/tests/interactive.test index 8d19512..e92b6d1 100644 --- a/tests/interactive.test +++ b/tests/interactive.test @@ -31,15 +31,15 @@ file delete test_history wait-for-prompt $p $p send "history load test_history\r" # skip echoed output -$p expect {\r\n} +$p expect "\r\n" wait-for-prompt $p test interactive-1.1 {basic command} -body { $p send "lsort \[info commands li*\]\r" # skip echoed output - $p expect {\r\n} + $p expect "\r\n" # get command result - $p expect {\r\n} + $p expect "\r\n" $p before } -result {lindex linsert list} -cleanup { wait-for-prompt $p @@ -57,7 +57,7 @@ test interactive-1.2 {command line completion} lineedit { $p expect {list} { incr check } $p send \r } - $p expect {\r\n} + $p expect "\r\n" wait-for-prompt $p list $check $failed @@ -65,8 +65,8 @@ test interactive-1.2 {command line completion} lineedit { test interactive-1.3 {history show} -constraints lineedit -body { $p send "history show\r" - $p expect {\r\n} - $p expect {history show\r\n} + $p expect "\r\n" + $p expect "history show\r\n" string cat [$p before] [$p after] } -result " 1 history load test_history\r\n 2 lsort \[info commands li*\]\r\n 3 list\r\n 4 history show\r\n" -cleanup { wait-for-prompt $p @@ -74,11 +74,11 @@ test interactive-1.3 {history show} -constraints lineedit -body { test interactive-1.4 {history getline} -constraints lineedit -body { $p send "history getline {PROMPT> }\r" - $p expect {\r\n} + $p expect "\r\n" sleep 0.25 $p send "abc\bd\x01e\r" - $p expect {\r\n} - $p expect {\r\n} + $p expect "\r\n" + $p expect "\r\n" $p before } -result {eabd} -cleanup { wait-for-prompt $p @@ -86,16 +86,16 @@ test interactive-1.4 {history getline} -constraints lineedit -body { test interactive-1.5 {history getline} -constraints lineedit -body { $p send "set len \[history getline {PROMPT> } buf\]\r" - $p expect {\r\n} + $p expect "\r\n" sleep 0.25 $p send "abcde\r" - $p expect {\r\n} - $p expect {\r\n} + $p expect "\r\n" + $p expect "\r\n" sleep 0.25 $p wait-for-prompt $p send "list \$len \$buf\r" - $p expect {\r\n} - $p expect {\r\n} + $p expect "\r\n" + $p expect "\r\n" $p before } -result {5 abcde} -cleanup { wait-for-prompt $p @@ -108,9 +108,9 @@ test interactive-1.6 {insert wide character} -constraints {utf8 lineedit} -body $p send \x1bOD $p send y $p send \r - $p expect {\r\n} + $p expect "\r\n" sleep 0.25 - $p expect {\r\n} + $p expect "\r\n" $p before } -result ay\u1100b -cleanup { wait-for-prompt $p @@ -123,9 +123,9 @@ test interactive-1.7 {insert utf-8 combining character} -constraints {utf8 linee $p send \x1bOD $p send y $p send \r - $p expect {\r\n} + $p expect "\r\n" sleep 0.25 - $p expect {\r\n} + $p expect "\r\n" $p before } -result yx\u0300 -cleanup { wait-for-prompt $p |