Referencia · §8.9
Tests
Ez az oldal a nucleus saját dokumentációjából készül, ezért angol nyelvű.
- The SQL layer’s sqllogictest scripts live in the test kit,
crates/testkit/slt/*.slt(one per area, numbered: basics, expressions, joins, aggregates, subqueries, indexes, constraints, transactions, plans, statistics, … through the types, roles, privileges, row-level security, tokens, access rules, protection and the analyzer), embedded innucleus-testkit(core_scripts()) with its runner (nucleus_testkit::slt), so the client’s tests and modules run them without reading files outside their folders.tests/slt.rsruns them locally,SLT=<name>one of them. The expected results of scripts 12–18 were produced by PostgreSQL 16 (records markednucleus-onlyexcepted: concurrency, and what PostgreSQL does not do).no_postgresql_without_pg_compatchecks that a session without the module sees nothing of PostgreSQL’s catalog. tests/encoding.rs: key order and round trips, property-tested (every type).tests/crash.rs: random DDL and DML (in autocommit and in blocks) throughSessionon the simulation, with a crash at every I/O operation in both crash modes; after reopening, the state is the one after every statement that returned (or the one in flight) andcheckfinds nothing.tests/format.rs: the format record.tests/slt.rsalso checks thatnow()is the simulated clock and fixed within a transaction (clock_timestamp()is not).cargo run -p nucleus-sql --example sql_script -- file.sqlprints the results of a script.