Commit Graph

19 Commits

Author SHA1 Message Date
Piotr Rzysko
20ea079679 Add framework for testing extensions in TCL
There is a distinction between tests that verify extension-specific
behavior and tests that verify interactions between the database engine
and extensions. Previously, both types of tests were kept in extensions.py.
With this new framework, we can extract the latter type of tests from
extensions.py into TCL. This cleans up extensions.py and provides
compatibility testing with SQLite at no extra cost.

To demonstrate the framework’s usage, tests verifying the handling of
virtual tables were extracted to TCL.

In the future, we may consider moving extension-specific tests to TCL as
well, especially those that have counterparts in SQLite or sqlean.
2025-08-15 21:06:27 +02:00
Piotr Rzysko
116673c2e5 Unify how SQL is executed in TCL tests 2025-08-15 21:06:17 +02:00
rajajisai
44ba3caaaa Remove miscellaneous characters generated due varying CLI size 2025-08-06 16:02:15 -07:00
Glauber Costa
cbdd5c5fc7 improve handling of double quotes
I ended up hitting #1974 today and wanted to fix it. I worked with
Claude to generate a more comprehensive set of queries that could fail
aside from just the insert query described in the issue. He got most of
them right - lots of cases were indeed failing. The ones that were
gibberish, he told me I was absolutely right for pointing out they were
bad.

But alas. With the test cases generated, we can work on fixing it. The
place where the assertion was hit, all we need to do there is return
true (but we assert that this is indeed a string literal, it shouldn't
be anything else at this point).

There are then just a couple of places where we need to make sure we
handle double quotes correctly. We already tested for single quotes in a
couple of places, but never for double quotes.

There is one funny corner case where you can just select "col" from tbl,
and if there is no column "col" on the table, that is treated as a
string literal. We handle that too.

Fixes #1974
2025-07-18 10:39:02 -05:00
pedrocarlo
5b15d6aa32 Get the table correctly from the connection instead of table_references + test to confirm unique constraint 2025-05-19 15:22:55 -03:00
pedrocarlo
f3a07c86a0 Add Ansi Colors to tcl test runner 2025-04-13 23:36:09 -03:00
Ihor Andrianov
ad91a2ae51 fix tests 2025-04-07 20:29:45 +03:00
Ihor Andrianov
3a97fd075f add tests 2025-04-07 20:02:14 +03:00
Glauber Costa
96987db6ca implement is and is not where constraints
The main difference between = and != is how null values are handled.
SQLite passes a flag "NULLEQ" to Eq and Ne to disambiguate that.
In the presence of that flag, NULL = NULL.

Some prep work is done to make sure we can pass a flag instead of a
boolean to Eq and Ne. I looked into the bitflags crate but got a bit
scared with the list of dependencies.
2025-01-31 23:01:49 -05:00
Diego Reis
9dea335a0a Add test function with regex 2024-12-27 11:39:02 -03:00
Lauri Virtanen
ca418c2674 Run do_execsql_test_tolerance for each database 2024-12-17 00:14:26 +02:00
Lauri Virtanen
aa82164717 Add FIXME comments about floating point comparison tolerance 2024-12-17 00:14:25 +02:00
Lauri Virtanen
793a85a14c Tolerate floating point minor differences in compatibility tests 2024-12-16 19:31:20 +02:00
jussisaurio
987a8bfb5d Run all tcl tests on 2 separate dbs (1. with rowid aliases 2. without rowid aliases) 2024-12-14 17:13:45 +02:00
김선우
910c69aaef Remove unused tcl proc 2024-09-22 08:43:50 -04:00
Kim Seon Woo
a95fcc0fc1 Fix test to check whether error message is included 2024-08-18 21:00:37 +02:00
Kim Seon Woo
c6402aa341 Add tcl 2024-08-18 21:00:36 +02:00
Pekka Enberg
5251f7a2f8 testing: Fix do_execsql_test() for JSON
The current scheme of combining SQL statements corrupts JSON by dropping
the curly braces. Fix the issue by passing the SQL statement almost as-is
to the database. However, for ".schema" to work, we need to trim extra
whitespace.
2024-07-26 09:48:48 +03:00
Pekka Enberg
4751820b2b testing: Move test harness to tester.tcl
Move the generic test harness part into a separate file.
2024-07-15 08:19:21 +03:00