test+docs: 3k Phase-3 verification sweep — e2e DML + filled cross-cut matrix
Sub-phase 3k of ADR-0033. Adds the Tier-3 end-to-end DML suite (tests/sql_dml_e2e.rs) and the cross-cut gap-fill tests, fills the verification matrix (every row a verified file::function), and produces the phase-exit report. - tests/sql_dml_e2e.rs: INSERT…SELECT cross-table, all-ten-type multi-row INSERT + RETURNING type recovery, UPDATE-with-subquery-in-SET, cascade DELETE, UPSERT round-trip, RETURNING x3, history.log replay, OOS rejections (full §13 table), validity-indicator-from-SQL-DML. - walker/mod.rs, highlight.rs, completion.rs, input_render.rs: inherited-diagnostic, DML-keyword highlight, INSERT INTO completion, and advanced-mode DML hint-panel cross-cuts. - Matrix correction (user-confirmed): predicate warnings fire on row-scoped DML slots; INSERT VALUES has no row scope (ADR-0033 §8.4). - Auto-snapshot row marked N/A (user-confirmed): ADR-0006 unimplemented for both paths; deferred. /runda round: added an advanced-mode DML hint-panel test (A6 was attributed to simple-mode prose under the §8 advanced heading); extended OOS coverage to the full ADR-0033 §13 table (OOS-5 INDEXED BY / OOS-6 multi-statement) + a trailing-semicolon guard. 1645 passing / 0 failing / 0 skipped / 1 ignored. Clippy clean.
This commit is contained in:
@@ -397,4 +397,38 @@ mod tests {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sql_dml_keywords_classified() {
|
||||
// ADR-0030 §8 / ADR-0033 — the DML entry words and clause
|
||||
// keywords (INSERT / INTO / VALUES / ON / CONFLICT /
|
||||
// RETURNING / UPDATE / SET / DELETE / FROM) all get the
|
||||
// Keyword class in Advanced mode. 3k cross-cut: the
|
||||
// ambient highlighter covers the DML surface, not just
|
||||
// SELECT.
|
||||
let keywords_of = |input: &'static str| -> Vec<&'static str> {
|
||||
run_advanced(input)
|
||||
.into_iter()
|
||||
.filter(|(_, _, c)| *c == HighlightClass::Keyword)
|
||||
.map(|(s, e, _)| &input[s..e])
|
||||
.collect()
|
||||
};
|
||||
|
||||
let insert = keywords_of(
|
||||
"insert into t (a) values (1) on conflict (a) do update set a = excluded.a returning a",
|
||||
);
|
||||
for kw in ["insert", "into", "values", "on", "conflict", "do", "update", "set", "returning"] {
|
||||
assert!(insert.contains(&kw), "INSERT/UPSERT: missing `{kw}`; got {insert:?}");
|
||||
}
|
||||
|
||||
let update = keywords_of("update t set a = 1 where id = 2 returning a");
|
||||
for kw in ["update", "set", "where", "returning"] {
|
||||
assert!(update.contains(&kw), "UPDATE: missing `{kw}`; got {update:?}");
|
||||
}
|
||||
|
||||
let delete = keywords_of("delete from t where id = 1 returning *");
|
||||
for kw in ["delete", "from", "where", "returning"] {
|
||||
assert!(delete.contains(&kw), "DELETE: missing `{kw}`; got {delete:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user