Files
turso/testing/like.test
Pekka Enberg 0c703a228d testing: Make individual test files executable
Each test file is standalone to make it easy to run just some specific
tests. However, some of the files didn't have the executable bit.
2024-07-29 09:41:40 +03:00

41 lines
776 B
Tcl
Executable File

#!/usr/bin/env tclsh
set testdir [file dirname $argv0]
source $testdir/tester.tcl
do_execsql_test like-fn {
select name, like('sweat%', name) from products;
} {hat|0
cap|0
shirt|0
sweater|1
sweatshirt|1
shorts|0
jeans|0
sneakers|0
boots|0
coat|0
accessories|0}
do_execsql_test where-like {
select * from products where name like 'sweat%';
} {4|sweater|25.0
5|sweatshirt|74.0}
do_execsql_test where-not-like-and {
select * from products where name not like 'sweat%' and price >= 70.0;
} {1|hat|79.0
2|cap|82.0
6|shorts|70.0
7|jeans|78.0
8|sneakers|82.0
11|accessories|81.0}
do_execsql_test where-like-or {
select * from products where name like 'sweat%' or price >= 80.0;
} {2|cap|82.0
4|sweater|25.0
5|sweatshirt|74.0
8|sneakers|82.0
11|accessories|81.0}