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 in nucleus-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.rs runs them locally, SLT=<name> one of them. The expected results of scripts 12–18 were produced by PostgreSQL 16 (records marked nucleus-only excepted: concurrency, and what PostgreSQL does not do). no_postgresql_without_pg_compat checks 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) through Session on 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) and check finds nothing. tests/format.rs: the format record. tests/slt.rs also checks that now() is the simulated clock and fixed within a transaction (clock_timestamp() is not).
  • cargo run -p nucleus-sql --example sql_script -- file.sql prints the results of a script.