test: H1a near-miss matrix + friendlier add 1:n relationship label (ADR-0042)
Start the ADR-0042 §1 near-miss matrix: a table-driven
near_miss_matrix_simple_mode locking 26 simple-mode parse-error
renderings (every DSL entry word's bare/missing-clause cases plus the
mode arg-errors and the "this is SQL" rail), and an #[ignore]
baseline_dump capturing the full rendering for ongoing triage.
G1 fix: the bare `1` cardinality literal that opens `add 1:n
relationship …` rendered cryptically in expected-sets. Render it as
`1:n relationship` in error wording only (format_expectation) —
completion/hints still read the raw Expectation::Literal("1"), so the
candidate surface is unchanged. Updated the one anchor test.
Full suite green (lib 1578 / it 382 / typing_surface_matrix 192).
This commit is contained in:
@@ -263,6 +263,16 @@ fn format_expectation(e: &crate::dsl::walker::outcome::Expectation) -> String {
|
||||
use crate::dsl::grammar::IdentSource;
|
||||
use crate::dsl::walker::outcome::Expectation;
|
||||
match e {
|
||||
// ADR-0042 G1: the bare `1` that opens `add 1:n
|
||||
// relationship …` is the project's only `Literal("1")`
|
||||
// (grammar `ddl.rs`); on its own in an expected-set it is
|
||||
// cryptic — a learner cannot know it begins a
|
||||
// relationship. Render it as the named construct in error
|
||||
// wording. This is render-only: completion/hints read the
|
||||
// raw `Expectation::Literal("1")` directly (offering the
|
||||
// literal `1` to type), so the candidate surface is
|
||||
// unchanged.
|
||||
Expectation::Literal("1") => "`1:n relationship`".to_string(),
|
||||
Expectation::Word(w) | Expectation::Literal(w) => format!("`{w}`"),
|
||||
Expectation::Ident { source, .. } => match source {
|
||||
// Match `IdentSlot::expected_label` outputs so the
|
||||
|
||||
Reference in New Issue
Block a user