aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authordrh <>2025-03-11 15:46:23 +0000
committerdrh <>2025-03-11 15:46:23 +0000
commit72b5c6db35df9382c976c0e1f125216e62489d4a (patch)
treef25f9b0637b01bfd64f3224a111ccaecc9c8b478 /test
parenta7829ecbdd9f0d20dd1d4e1386038ab1e7655f5a (diff)
downloadsqlite-72b5c6db35df9382c976c0e1f125216e62489d4a.tar.gz
sqlite-72b5c6db35df9382c976c0e1f125216e62489d4a.zip
Avoid running test cases involving ANSI control characters or Unicode
on Windows in a slave interpreter, as that combination does not work. FossilOrigin-Name: f6745a7355c62ee64c08e23b795f437dd74add903b55e1255c1d03f9a811170d
Diffstat (limited to 'test')
-rw-r--r--test/shell1.test6
-rw-r--r--test/shell4.test2
-rw-r--r--test/shell5.test4
-rw-r--r--test/shellA.test12
-rw-r--r--test/tester.tcl9
5 files changed, 21 insertions, 12 deletions
diff --git a/test/shell1.test b/test/shell1.test
index 598005a90..f89d34d53 100644
--- a/test/shell1.test
+++ b/test/shell1.test
@@ -1228,7 +1228,7 @@ do_test shell1-8.1 {
FROM pow2, c WHERE pow2.x=ieee754_exponent(c.n);
}
} {0 47.49000000000000198951966012828052043914794921875}
-do_test shell1-8.2 {
+do_test_with_ansi_output shell1-8.2 {
catchcmd :memory: {
.mode box
SELECT ieee754(47.49) AS x;
@@ -1238,7 +1238,7 @@ SELECT ieee754(47.49) AS x;
├───────────────────────────────┤
│ ieee754(6683623321994527,-47) │
└───────────────────────────────┘}}
-do_test shell1-8.3 {
+do_test_with_ansi_output shell1-8.3 {
catchcmd ":memory: --box" {
select ieee754(6683623321994527,-47) as x;
}
@@ -1254,7 +1254,7 @@ do_test shell1-8.4 {
+------------------+-----+
| 6683623321994527 | -47 |
+------------------+-----+}}
-do_test shell1-8.5 {
+do_test_with_ansi_output shell1-8.5 {
catchcmd ":memory: --box" {
create table t(a text, b int);
insert into t values ('too long for one line', 1), ('shorter', NULL);
diff --git a/test/shell4.test b/test/shell4.test
index 4b7e9b8ee..4275911ef 100644
--- a/test/shell4.test
+++ b/test/shell4.test
@@ -140,7 +140,7 @@ do_test shell4-3.1 {
close $fd
exec $::CLI_ONLY :memory: --interactive ".read t1.txt"
} {squirrel}
-do_test shell4-3.2 {
+do_test_with_ansi_output shell4-3.2 {
set fd [open t1.txt wb]
puts $fd "SELECT 'pound: \302\243';"
close $fd
diff --git a/test/shell5.test b/test/shell5.test
index 8eb905974..70a2298bc 100644
--- a/test/shell5.test
+++ b/test/shell5.test
@@ -553,7 +553,7 @@ Columns renamed during .import shell5.csv due to duplicates:
# Tests for preserving utf-8 that is not also ASCII.
#
-do_test shell5-6.1 {
+do_test_with_ansi_output shell5-6.1 {
set out [open shell5.csv w]
fconfigure $out -translation lf
puts $out {あい,うえお}
@@ -566,7 +566,7 @@ SELECT * FROM t1;}
} {0 { あい = 1
うえお = 2}}
-do_test shell5-6.2 {
+do_test_with_ansi_output shell5-6.2 {
set out [open shell5.csv w]
fconfigure $out -translation lf
puts $out {1,2}
diff --git a/test/shellA.test b/test/shellA.test
index 1a8161bf3..f3959d428 100644
--- a/test/shellA.test
+++ b/test/shellA.test
@@ -35,7 +35,7 @@ do_execsql_test shellA-1.0 {
# Initial verification that the database created correctly
# and that our calls to the CLI are working.
#
-do_test shellA-1.2 {
+do_test_with_ansi_output shellA-1.2 {
exec {*}$CLI test.db {.mode box --escape symbol} {SELECT * FROM t1;}
} {
┌───┬──────────────────────────┐
@@ -67,7 +67,7 @@ do_test shellA-1.3 {
} {
^[[31mVT-100 codes^[[0m
}
-do_test shellA-1.4 {
+do_test_with_ansi_output shellA-1.4 {
exec {*}$CLI test.db --escape symbol {SELECT x FROM t1 WHERE a=2;}
} {
␛[31mVT-100 codes␛[0m
@@ -77,7 +77,7 @@ do_test shellA-1.5 {
} {
^[[31mVT-100 codes^[[0m
}
-do_test shellA-1.6 {
+do_test_with_ansi_output shellA-1.6 {
exec {*}$CLI test.db {.mode list --escape symbol} {SELECT x FROM t1 WHERE a=2;}
} {
␛[31mVT-100 codes␛[0m
@@ -134,7 +134,7 @@ do_test shellA-2.4 {
# ".mode line"
#
-do_test shellA-3.1 {
+do_test_with_ansi_output shellA-3.1 {
exec {*}$CLI test.db --line --escape symbol \
{SELECT a, x FROM t1 WHERE a IN (1,2,6,7,8)}
} {
@@ -177,7 +177,7 @@ line
# ".mode box"
#
-do_test shellA-4.1 {
+do_test_with_ansi_output shellA-4.1 {
exec {*}$CLI test.db --box --escape ascii \
{SELECT a, x FROM t1 WHERE a IN (1,2,6,7,8)}
} {
@@ -196,7 +196,7 @@ do_test shellA-4.1 {
│ 8 │ last line │
└───┴──────────────────────────┘
}
-do_test shellA-4.2 {
+do_test_with_ansi_output shellA-4.2 {
exec {*}$CLI test.db {.mode qbox} {SELECT a, x FROM t1 WHERE a IN (1,2,6,7,8)}
} {
┌───┬───────────────────────────────────────────┐
diff --git a/test/tester.tcl b/test/tester.tcl
index 66d9aeae3..444a9d843 100644
--- a/test/tester.tcl
+++ b/test/tester.tcl
@@ -809,6 +809,15 @@ proc do_test {name cmd expected} {
flush stdout
}
+# Like do_test except the test is not run in a slave interpreter
+# on Windows because of issues with ANSI and UTF8 I/O on Win11.
+#
+proc do_test_with_ansi_output {name cmd expected} {
+ if {![info exists ::SLAVE] || $::tcl_platform(platform)!="windows"} {
+ uplevel 1 [list do_test $name $cmd $expected]
+ }
+}
+
proc dumpbytes {s} {
set r ""
for {set i 0} {$i < [string length $s]} {incr i} {