Files
inkwell/core/testdata/grammar.json
T
bvandeusenandClaude Opus 5.5 535331c5b2
CI & Build / Python lint (push) Successful in 2s
CI & Build / Build now, or wait for Android? (push) Successful in 3s
Android / Build, or is the channel already serving this? (push) Successful in 3s
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 1s
CI & Build / Web typecheck and unit tests (push) Successful in 9s
CI & Build / Python tests (push) Failing after 12s
CI & Build / integration (push) Failing after 27s
CI & Build / Build & push image (push) Skipped
Desktop (Tauri) / Web tests, clippy, Rust tests and rustfmt (push) Successful in 4m25s
Desktop (Tauri) / Windows installer (cross-compiled) (push) Successful in 3m28s
Desktop (Tauri) / Tauri desktop (Linux) (push) Successful in 4m19s
Desktop (Tauri) / Update manifest (push) Successful in 9s
Android / Kotlin + Rust (APK) (push) Canceled after 11m21s
tests: one fixture for the note grammar, run by the core, the server and the web
The checklist grammar and the #tag rule are implemented three times (derive.rs,
checklist.py/tags.py, markdown.ts), and the tag colour twice (colors.ts,
DerivedTint.kt). Only Rust and Kotlin had tests. core/testdata/grammar.json now
holds one set of cases (task lines, rendered items, tags, standalone-tag lifts
and the tint hashes), and every suite reads it.

- web: vitest, a dev dependency approved for #5166, with `npm test`.
  grammar.test.ts runs the fixture, and titles.test.ts pins #5165's palette fix.
- ci.yml runs the web tests in the job the image build needs. desktop.yml's
  verify job runs them too, because the installers embed this frontend and
  can't see ci.yml's verdict (rule 177).
- core: derive.rs reads the fixture. server: tests/test_grammar_fixture.py.
- Android keeps its hand-written tint values; its doc now points at the fixture.

The server is expected red here, on purpose. tags.py only takes a tag after
whitespace and lets it start with a digit or `_`, while the core (the
definition) takes any non-tag boundary and needs a letter. So `(#todo)` is a
label on the phone and plain text on the server. The fix follows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 23:11:26 -04:00

89 lines
4.7 KiB
JSON

{
"_about": [
"The cases every implementation of the note grammar is tested against.",
"One file, read by four test suites: core (derive.rs), the server (checklist.py, tags.py), the web (markdown.ts, colors.ts) and, for the tint, Android (DerivedTint.kt, which pins the same values by hand).",
"A difference between any two implementations is a note that changes shape when it syncs. Add a case here, not to one suite.",
"Lives under core/ because core is the definition, and because core/ is in the desktop, Android and server file sets, so changing a case reruns every suite that reads it.",
"Tag cases are plain text on purpose. The web's renderer lets `code` and **bold** claim a `#` first, which the derivers do not; that is a rendering choice, not grammar, and is tested where it lives."
],
"task_lines": [
{ "line": "- [ ] milk", "item": { "checked": false, "text": "milk" } },
{ "line": "- [x] milk", "item": { "checked": true, "text": "milk" } },
{ "line": "- [X] milk", "item": { "checked": true, "text": "milk" } },
{ "line": "* [ ] star bullet", "item": { "checked": false, "text": "star bullet" } },
{ "line": " - [ ] indented", "item": { "checked": false, "text": "indented" } },
{ "line": "\t- [ ] tab indent", "item": { "checked": false, "text": "tab indent" } },
{ "line": "- [ ] two spaces after the bullet", "item": { "checked": false, "text": "two spaces after the bullet" } },
{ "line": "- [ ]", "item": { "checked": false, "text": "" } },
{ "line": "- [ ] ", "item": { "checked": false, "text": "" } },
{ "line": "- [ ] trailing space kept ", "item": { "checked": false, "text": "trailing space kept " } },
{ "line": "- [ ]x", "item": null },
{ "line": "-[ ] x", "item": null },
{ "line": "+ [ ] plus bullet", "item": null },
{ "line": "- [y] x", "item": null },
{ "line": "- [ ] x", "item": null },
{ "line": "text - [ ] x", "item": null },
{ "line": "- milk", "item": null },
{ "line": "", "item": null }
],
"rendered_items": [
{ "text": "milk", "checked": false, "line": "- [ ] milk" },
{ "text": "milk", "checked": true, "line": "- [x] milk" },
{ "text": "", "checked": false, "line": "- [ ]" },
{ "text": "", "checked": true, "line": "- [x]" }
],
"tags": [
{ "body": "#todo buy milk", "tags": ["todo"] },
{ "body": "buy #milk and #eggs", "tags": ["milk", "eggs"] },
{ "body": "#Todo and #todo", "tags": ["Todo"] },
{ "body": "line one\n#two", "tags": ["two"] },
{ "body": "#tag, and #more.", "tags": ["tag", "more"] },
{ "body": "#x-y_z9", "tags": ["x-y_z9"] },
{ "body": "#café #über", "tags": ["café", "über"] },
{ "body": "(#todo)", "tags": ["todo"] },
{ "body": "end.#tag", "tags": ["tag"] },
{ "body": "#tag#more", "tags": ["tag"] },
{ "body": "a#b", "tags": [] },
{ "body": "x-#tag", "tags": [] },
{ "body": "##x", "tags": [] },
{ "body": "#1st", "tags": [] },
{ "body": "#2024", "tags": [] },
{ "body": "#_x", "tags": [] },
{ "body": "# heading", "tags": [] },
{ "body": "see https://x.com/page#frag", "tags": [] },
{ "body": "", "tags": [] }
],
"lifts": [
{ "body": "#todo\nreorganize the homepage", "standalone": ["todo"], "inline": [], "lifted": "reorganize the homepage" },
{ "body": "buy milk #grocery", "standalone": [], "inline": ["grocery"], "lifted": "buy milk #grocery" },
{ "body": "first\n\n#todo\n\nsecond", "standalone": ["todo"], "inline": [], "lifted": "first\n\nsecond" },
{ "body": "#todo\ncall #todo later", "standalone": [], "inline": ["todo"], "lifted": "call #todo later" },
{ "body": "#a #b", "standalone": [], "inline": ["a", "b"], "lifted": "#a #b" },
{ "body": "```\n# comment #todo\n```", "standalone": [], "inline": ["todo"], "lifted": "```\n# comment #todo\n```" },
{ "body": "(#todo)\nnotes", "standalone": [], "inline": ["todo"], "lifted": "(#todo)\nnotes" }
],
"tint": {
"keys": ["red", "orange", "yellow", "green", "teal", "blue", "purple", "pink", "gray"],
"hashes": [
{ "id": "00000000-0000-0000-0000-000000000000", "hash": 3192360657, "color": "purple" },
{ "id": "11111111-1111-1111-1111-111111111111", "hash": 1031130113, "color": "blue" },
{ "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "hash": 4043892016, "color": "orange" },
{ "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "hash": 1533351232, "color": "orange" }
],
"names": [
{ "name": "todo", "color": "pink" },
{ "name": "grocery", "color": "blue" },
{ "name": "work", "color": "green" },
{ "name": "home", "color": "gray" },
{ "name": "ideas", "color": "green" },
{ "name": "reading", "color": "gray" },
{ "name": "urgent", "color": "red" }
]
}
}