feat(hint): H2 Phase C batch 4 — advanced-mode SQL tier-3 hints (ADR-0053)
Distinct SQL-syntax hints for the 11 advanced-mode forms: sql create table / alter table / create index / drop index / drop table / insert / update / delete, select, with, explain. hint_ids wired on all 11 nodes. Hardened hint_key_for_input_in_mode for shared entry words: a bare multi-form entry word defers to tier-2; when the second token isn't a form word (insert into / update … set), it falls back to the mode-primary key — so advanced mode resolves to the SQL form and simple mode to the DSL form. catalogue + keys.rs registered. +2 spot tests + grammar mode-disambiguation asserts; 2495 pass / 1 ignored, clippy clean.
This commit is contained in:
+21
@@ -5901,6 +5901,27 @@ mod tests {
|
||||
assert!(!output_contains(&app, "rows stored in a table"));
|
||||
}
|
||||
|
||||
// ── Phase C batch 4: advanced-SQL hints (mode-aware) ────────
|
||||
|
||||
#[test]
|
||||
fn f1_in_advanced_mode_renders_the_sql_insert_hint() {
|
||||
let mut app = App::new();
|
||||
app.mode = Mode::Advanced;
|
||||
type_str(&mut app, "insert into Customers (name) values ('x')");
|
||||
f1(&mut app);
|
||||
assert!(output_contains(&app, "Insert rows with SQL"));
|
||||
assert!(!output_contains(&app, "Add one or more rows"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn f1_on_select_renders_the_select_hint() {
|
||||
let mut app = App::new();
|
||||
app.mode = Mode::Advanced;
|
||||
type_str(&mut app, "select name from Customers");
|
||||
f1(&mut app);
|
||||
assert!(output_contains(&app, "heart of SQL"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn messages_command_toggles_verbosity_and_reports() {
|
||||
let mut app = App::new();
|
||||
|
||||
Reference in New Issue
Block a user