Loading...
Loading...
How to write tests, when to use each type of test, and how to run them. Contains information about conversion of `.test` to `.sqltest`, and how to write `.sqltest` and rust tests
npx skill4agent add tursodatabase/turso testing| Type | Location | Use Case |
|---|---|---|
| | SQL compatibility. Preferred for new tests |
TCL | | Legacy SQL compat (being phased out) |
| Rust integration | | Regression tests, complex scenarios |
| Fuzz | | Complex features, edge case discovery |
.sqltest# 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/runner run-cli
# Rust unit/integration tests (full workspace)
cargo test@database :default:
test example-addition {
SELECT 1 + 1;
}
expect {
2
}
test example-multiple-rows {
SELECT id, name FROM users WHERE id < 3;
}
expect {
1|alice
2|bob
}testing/runner/tests/*.sqltestconvertcargo run -- convert <TCL_test_path> -o <out_dir>make -C testing/runner run-rust.sqltestdo_execsql_test_on_specific_db {:memory:} test-name {
SELECT 1 + 1;
} {2}testing/*.test// tests/integration/test_foo.rs
#[test]
fn test_something() {
let conn = Connection::open_in_memory().unwrap();
// ...
}:memory:{:memory:}testing/system/testing.dbusersproductsRUST_LOG=none,turso_core=trace make testtesting/system/test.log