limbo/testing/collate.test
Jussi Saurio 022f679fab chore: make every CREATE TABLE stmt in entire repo have 1 space after tbl name
`BTreeTable::to_sql` makes us incompatible with SQLite by losing e.g. the original whitespace provided during the CREATE TABLE command.

For now let's fix our tests by regex-replacing every CREATE TABLE in
the entire repo to have exactly 1 space after the table name in the
CREATE TABLE statement.
2025-07-22 11:35:21 +03:00

52 lines
1.3 KiB
Tcl
Executable file

#!/usr/bin/env tclsh
set testdir [file dirname $argv0]
source $testdir/tester.tcl
# SIMPLE SMOKE TESTS THAT DO NOT DEPEND ON SPECIFIC DATABASE ROWS
do_execsql_test collate_nocase {
SELECT 'hat' == 'hAt' COLLATE NOCASE;
} {1}
do_execsql_test collate_binary_1 {
SELECT 'hat' == 'hAt' COLLATE BINARY;
} {0}
do_execsql_test collate_binary_2 {
SELECT 'hat' == 'hat' COLLATE BINARY;
} {1}
do_execsql_test collate_rtrim_1 {
SELECT 'hat' == 'hAt ' COLLATE RTRIM;
} {0}
do_execsql_test collate_rtrim_2 {
SELECT 'hat' == 'hat ' COLLATE RTRIM;
} {1}
do_execsql_test collate_rtrim_3 {
SELECT 'hat' == ' hAt ' COLLATE RTRIM;
} {0}
do_execsql_test collate_rtrim_4 {
SELECT 'hat' == ' hat ' COLLATE RTRIM;
} {0}
do_execsql_test collate_left_precedence {
SELECT 'hat' COLLATE BINARY == 'hAt' COLLATE NOCASE;
} {0}
do_execsql_test collate_left_precedence_2 {
SELECT 'hat' COLLATE NOCASE == 'hAt' COLLATE BINARY;
} {1}
do_execsql_test_in_memory_any_error collate_unique_constraint {
CREATE TABLE t (a TEXT COLLATE NOCASE PRIMARY KEY);
INSERT INTO t VALUES ('lol'), ('LOL'), ('lOl');
}
do_execsql_test_in_memory_any_error collate_unique_constraint {
CREATE TABLE t (a TEXT COLLATE NOCASE PRIMARY KEY);
INSERT INTO t VALUES ('lol'), ('LOL'), ('lOl');
}