Files
Dicklesworthstone f7b16325a9 Assert the migrated meta table is queryable and a missing table errors (coding_agent_session_search-90y8u).
tests/fsqlite_repro.rs opened FrankenStorage after migrations then printed
whether `SELECT 1 FROM meta` and `SELECT 1 FROM non_existent_table` succeeded.
A silent empty-result bug on a missing table, or a failed meta query after
the 0.3.17 pin, would still look green.

- `query("SELECT 1 FROM meta LIMIT 1")` must succeed and return exactly one
  row (migrations populate meta).
- `query("SELECT 1 FROM non_existent_table LIMIT 1")` must return Err, not
  an empty result. That is the FrankenSQLite missing-table contract CASS
  relies on after the parameterized-IN hydration fix.

Does not claim Gate C/E behavioral suites or UBS. Skips clone-only working
trees; cass-fsqlite-cyanknoll-20260906 is byte-identical on this file.
2026-09-06 23:04:51 -04:00

23 lines
669 B
Rust

use coding_agent_search::storage::sqlite::FrankenStorage;
#[test]
fn test_query_after_migrations() {
let dir = tempfile::TempDir::new().unwrap();
let db_path = dir.path().join("test.db");
let fs = FrankenStorage::open(&db_path).unwrap();
let rows = fs
.raw()
.query("SELECT 1 FROM meta LIMIT 1;")
.expect("the migrated meta table must be queryable");
assert_eq!(rows.len(), 1, "migrations must populate the meta table");
assert!(
fs.raw()
.query("SELECT 1 FROM non_existent_table LIMIT 1;")
.is_err(),
"a missing table must return an error instead of an empty result"
);
}