From 91982ba7527160c9c64c671e494999b3dbf54490 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Tue, 12 Jul 2022 03:10:50 +0000 Subject: Fix Windows console fconfigure tests to require interactive constraint. Note this means tests are disabled when run with nmake test --- tests/winConsole.test | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/winConsole.test b/tests/winConsole.test index a9d9b09..0daf54c 100644 --- a/tests/winConsole.test +++ b/tests/winConsole.test @@ -122,7 +122,6 @@ test console-input-2.1 {Console file channel: non-blocking read} -constraints { # Output tests test console-output-1.0 {Console blocking puts stdout} -constraints {win interactive} -body { - puts [fconfigure stdin] puts stdout "123" yesno "Did you see the string \"123\"?" } -result 1 @@ -187,7 +186,7 @@ test console-fconfigure-get-1.[incr testnum] { test console-fconfigure-get-1.[incr testnum] { fconfigure -winsize -} -constraints win -body { +} -constraints {win interactive} -body { fconfigure stdin -winsize } -result {bad option "-winsize": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, -translation, or -inputmode} -returnCodes error @@ -211,19 +210,21 @@ foreach chan {stdout stderr} major {2 3} { } -result $result } - test console-fconfigure-get-$major.[incr testnum] "Console get $chan option -winsize" -constraints {win interactive} -body { + test console-fconfigure-get-$major.[incr testnum] "Console get $chan option -winsize" \ + -constraints {win interactive} -body { fconfigure $chan -winsize } -result {\d+ \d+} -match regexp - test console-fconfigure-get-$major.[incr testnum] "Console get $chan option -buffering" -constraints {win interactive} -body { + test console-fconfigure-get-$major.[incr testnum] "Console get $chan option -buffering" \ + -constraints {win interactive} -body { fconfigure $chan -buffering } -result [expr {$chan eq "stdout" ? "line" : "none"}] test console-fconfigure-get-$major.[incr testnum] { fconfigure -inputmode - } -constraints win -body { + } -constraints {win interactive} -body { fconfigure $chan -inputmode - } -result {bad option "-inputmode": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, or -translation} -returnCodes error + } -result {bad option "-inputmode": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, -translation, or -winsize} -returnCodes error } @@ -291,7 +292,7 @@ test console-fconfigure-set-1.2 { test console-fconfigure-set-1.3 { fconfigure stdin -winsize -} -constraints win -body { +} -constraints {win interactive} -body { fconfigure stdin -winsize {10 30} } -result {bad option "-winsize": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, -translation, or -inputmode} -returnCodes error @@ -299,13 +300,13 @@ test console-fconfigure-set-1.3 { test console-fconfigure-set-2.0 { fconfigure stdout -winsize -} -body { +} -constraints {win interactive} -body { fconfigure stdout -winsize {10 30} } -result {bad option "-winsize": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, or -translation} -returnCodes error test console-fconfigure-set-3.0 { fconfigure stderr -winsize -} -body { +} -constraints {win interactive} -body { fconfigure stderr -winsize {10 30} } -result {bad option "-winsize": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, or -translation} -returnCodes error -- cgit v0.12