| name | testing |
|---|---|
| description | Test types, when to use each, how to write and run tests |
| Type | Location | Use Case |
|---|---|---|
.sqltest |
testing/sqltests/tests/ |
SQL compatibility. Preferred for new tests |
TCL .test |
testing/ |
Legacy SQL compat (being phased out) |
| Rust integration | tests/integration/ |
Regression tests, complex scenarios |
| Fuzz | tests/fuzz/ |
Complex features, edge case discovery |
Note: TCL tests are being phased out in favor of testing/sqltests. The .sqltest format allows the same test cases to run against multiple backends (CLI, Rust bindings, etc.).
# Main test suite (TCL compat, sqlite3 compat, Python wrappers)
make test
# Single TCL test
make test-single TEST=select.test
# SQL test runner
make -C testing/sqltests run-cli
# Rust unit/integration tests (full workspace)
cargo test@database :memory:
@query
SELECT 1 + 1;
@expected
2Location: testing/sqltests/tests/*.sqltest
do_execsql_test_on_specific_db {:memory:} test-name {
SELECT 1 + 1;
} {2}Location: testing/*.test
// tests/integration/test_foo.rs
#[test]
fn test_something() {
let conn = Connection::open_in_memory().unwrap();
// ...
}- Every functional change needs a test
- Test must fail without change, pass with it
- Prefer in-memory DBs:
:memory:(sqltest) or{:memory:}(TCL) - Don't invent new test formats. Follow existing patterns
- Write tests first when possible
testing/testing.db has users and products tables. See docs/testing.md for schema.
RUST_LOG=none,turso_core=trace make testOutput: testing/test.log. Warning: very verbose.