Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions conformance/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Conformance cases

Portable cases grouped by the compiler phase they exercise. Each case is a directory holding a
`case.json` (see `schemas/case.schema.json`) and one `.medui` fixture. `tools/validate.py` checks
their structure; an implementation runs them and compares observable behaviour.

A rejection case pins a full position — `line` and `column`, 1-based, columns in UTF-8 bytes. The
pinned position points at **the token that carries the violation**, and every consumer reproduces
it as far as its declared `positions` precision goes (`spec/diagnostics.md`).

## Registered-code coverage

Every registered `MEDUI-E###` should have at least one case once it is mechanically expressible.
Codes still without one, and why:

| Code | Meaning | Blocked on |
|---|---|---|
| `MEDUI-E000`–`MEDUI-E003` | recipe / source I/O failures | a fixture convention for a broken or missing recipe file alongside the `.medui` source |
| `MEDUI-E016` | forbidden construct | a grammar-level statement of what a "forbidden construct" is versus an unexpected token (`MEDUI-E010`) |
| `MEDUI-E050` | text budget exceeded | a font / text-measurement model; the contract has none yet |
| `MEDUI-E053` | dynamic text escapes its charset | a charset model and charset-package `inputs`, the same gap that leaves `charset` resolution uncoded |

Adding any of these is a contract change (a case defines an outcome), not a drop-in fixture.
9 changes: 9 additions & 0 deletions conformance/layout/positioned-node-overflow/case.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"id": "MEDUI-CASE-LAYOUT-POSITIONED-NODE-OVERFLOW",
"phase": "layout",
"source": "source.medui",
"expected": {
"valid": false,
"diagnostics": [{ "code": "MEDUI-E051", "line": 8, "column": 9 }]
}
}
12 changes: 12 additions & 0 deletions conformance/layout/positioned-node-overflow/source.medui
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Screen PositionedNodeOverflow {
layout: Vertical { spacing: 0px; padding: 0px; }
surface: 200px, 200px;
Label {
id: edge;
width: 100px;
height: 40px;
position: 150px, 0px;
text: t("STR-EDGE");
color: Theme.Colors.Title;
}
}
9 changes: 9 additions & 0 deletions conformance/layout/surface-exceeded/case.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"id": "MEDUI-CASE-LAYOUT-SURFACE-EXCEEDED",
"phase": "layout",
"source": "source.medui",
"expected": {
"valid": false,
"diagnostics": [{ "code": "MEDUI-E052", "line": 6, "column": 16 }]
}
}
11 changes: 11 additions & 0 deletions conformance/layout/surface-exceeded/source.medui
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Screen SurfaceExceeded {
layout: Vertical { spacing: 0px; padding: 0px; }
surface: 100px, 100px;
Label {
id: banner;
width: 200px;
height: 24px;
text: t("STR-TITLE");
color: Theme.Colors.Title;
}
}
9 changes: 9 additions & 0 deletions conformance/safety/unknown-cv-check/case.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"id": "MEDUI-CASE-SAFETY-UNKNOWN-CV-CHECK",
"phase": "safety",
"source": "source.medui",
"expected": {
"valid": false,
"diagnostics": [{ "code": "MEDUI-E071", "line": 3, "column": 33 }]
}
}
13 changes: 13 additions & 0 deletions conformance/safety/unknown-cv-check/source.medui
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Screen UnknownCvCheck {
layout: Vertical { spacing: 0px; padding: 0px; }
@safety_critical(cv_check: [Bogus])
Button {
id: action;
width: 100px;
height: 40px;
label: t("STR-ACTION");
color: Theme.Colors.PrimaryAction;
source: "ACTION";
requirement: "REQ-UCC-001";
}
}
9 changes: 9 additions & 0 deletions conformance/syntax/duplicate-node-id/case.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"id": "MEDUI-CASE-SYNTAX-DUPLICATE-NODE-ID",
"phase": "syntax",
"source": "source.medui",
"expected": {
"valid": false,
"diagnostics": [{ "code": "MEDUI-E014", "line": 11, "column": 13 }]
}
}
17 changes: 17 additions & 0 deletions conformance/syntax/duplicate-node-id/source.medui
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Screen DuplicateNodeId {
layout: Vertical { spacing: 0px; padding: 0px; }
Label {
id: title;
width: 100px;
height: 24px;
text: t("STR-TITLE");
color: Theme.Colors.Title;
}
Label {
id: title;
width: 100px;
height: 24px;
text: t("STR-SUBTITLE");
color: Theme.Colors.Title;
}
}
9 changes: 9 additions & 0 deletions conformance/syntax/source-not-utf8/case.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"id": "MEDUI-CASE-SYNTAX-SOURCE-NOT-UTF8",
"phase": "syntax",
"source": "source.medui",
"expected": {
"valid": false,
"diagnostics": [{ "code": "MEDUI-E004", "line": 1, "column": 8 }]
}
}
2 changes: 2 additions & 0 deletions conformance/syntax/source-not-utf8/source.medui
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Screen ÿþ {
}
9 changes: 9 additions & 0 deletions conformance/syntax/unexpected-token/case.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"id": "MEDUI-CASE-SYNTAX-UNEXPECTED-TOKEN",
"phase": "syntax",
"source": "source.medui",
"expected": {
"valid": false,
"diagnostics": [{ "code": "MEDUI-E010", "line": 5, "column": 22 }]
}
}
10 changes: 10 additions & 0 deletions conformance/syntax/unexpected-token/source.medui
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Screen UnexpectedToken {
layout: Vertical { spacing: 0px; padding: 0px; }
Label {
id: title;
width: 100px 100px;
height: 24px;
text: t("STR-TITLE");
color: Theme.Colors.Title;
}
}
Loading