npx skills add https://github.com/tursodatabase/turso --skill testing| 类型 | 位置 | 使用场景 |
|---|---|---|
.sqltest | testing/sqltests/tests/ | SQL 兼容性测试。新测试首选 |
TCL .test | testing/ | 遗留 SQL 兼容性测试(正在逐步淘汰) |
| Rust 集成测试 | tests/integration/ | 回归测试、复杂场景测试 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 模糊测试 |
tests/fuzz/ |
| 复杂功能测试、边界情况发现 |
注意: TCL 测试正在逐步淘汰,转而使用 testing/sqltests。.sqltest 格式允许相同的测试用例在多个后端(CLI、Rust 绑定等)上运行。
# 主测试套件(TCL 兼容性、sqlite3 兼容性、Python 包装器)
make test
# 单个 TCL 测试
make test-single TEST=select.test
# SQL 测试运行器
make -C testing/sqltests run-cli
# 或者
cargo run -p test-runner -- run <测试文件或目录>
# Rust 单元/集成测试(完整工作空间)
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/sqltests/tests/*.sqltest
你必须使用测试运行器的 convert 命令开始转换 TCL 测试(例如 cargo run -- convert <TCL_测试路径> -o <输出目录>)。转换并不总是准确的,但会转换大部分测试。如果某些转换发出警告,你需要手动编写缺失的部分(例如手动展开每个循环)。然后你需要通过运行 make -C testing/sqltests run-rust 来验证测试是否正常工作,如果转换有问题,则调整其输出。此外,我们在 TCL 中使用硬编码的数据库,但在 .sqltest 中我们使用不同的种子生成数据库,因此你可能需要更改预期的测试结果以匹配新的数据库查询输出。避免更改测试中的 SQL 语句,只需更改预期结果。
do_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:(sqltest)或 {:memory:}(TCL)testing/system/testing.db 包含 users 和 products 表。有关模式信息,请参阅 docs/testing.md。
RUST_LOG=none,turso_core=trace make test
输出:testing/system/test.log。警告:输出非常详细。
每周安装次数
375
代码仓库
GitHub 星标数
17.9K
首次出现时间
2026年1月28日
安全审计
安装于
claude-code292
github-copilot180
codex116
gemini-cli114
opencode114
cursor107
| 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
# OR
cargo run -p test-runner -- run <test-file or directory>
# 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
}
Location: testing/sqltests/tests/*.sqltest
You must start converting TCL tests with the convert command from the test runner (e.g cargo run -- convert <TCL_test_path> -o <out_dir>). It is not always accurate, but it will convert most of the tests. If some conversion emits a warning you will have to write by hand whatever is missing from it (e.g unroll a for each loop by hand). Then you need to verify the tests work by running them with make -C testing/sqltests run-rust, and adjust their output if something was wrong with the conversion. Also, we use harcoded databases in TCL, but with .sqltest we generate the database with a different seed, so you will probably need to change the expected test result to match the new database query output. Avoid changing the SQL statements from the test, just change the expected result
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();
// ...
}
:memory: (sqltest) or {:memory:} (TCL)testing/system/testing.db has users and products tables. See docs/testing.md for schema.
RUST_LOG=none,turso_core=trace make test
Output: testing/system/test.log. Warning: very verbose.
Weekly Installs
375
Repository
GitHub Stars
17.9K
First Seen
Jan 28, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code292
github-copilot180
codex116
gemini-cli114
opencode114
cursor107
浏览器自动化专家指南:Playwright、Puppeteer、Selenium 最佳实践与反模式
3,100 周安装
Python类型注解模式指南:现代类型提示与Typing最佳实践
24 周安装
Web应用安全模式指南:OWASP Top 10防护、输入验证、身份认证与授权最佳实践
25 周安装
task-runner任务运行器:使用just简化项目命令执行,替代make的跨平台工具
30 周安装
EdgeOne Pages 一键部署:无需账户,秒级将HTML文件发布到公共URL
35 周安装
Vibe Security 安全扫描器 - 多语言代码漏洞检测与AI智能修复工具
38 周安装
wechat-publisher:一键发布Markdown文章到微信公众号草稿箱工具
323 周安装