Ord - Outline and Relational Data

A simple and powerful markup language for note-taking and structured information.

Ord test format

Version 0.7.0-draft, 2026-11-22. A companion spec to Ord specification, of the same version. The Spec's conventions (S1 to S6) and versioning (S10) apply here. Its rules start with D (the dump) and T (tests), and other rule IDs refer to the Spec.

Part A defines the dump, the text form of the data model that tests compare against. Part B says how tests are written in the specs and how a runner runs them.

A. AST dump

The dump is a text form of the data model (Spec, section 1). Read tests compare it as a string, so implementations only need to print it. Two test options add to it: ranges (A3) and label syntax (A4). With both off, the dump is Core only.

A1. Lines

A2. Strings

A3. Ranges

A4. Label syntax

A5. Grammar

Which elements may appear where is set by D3, D4 and D12 to D14, not by the grammar.

dump      = %s"root" LF *elem-line *diag-line
elem-line = indent elem [SP range] LF
indent    = 1*(2SP)                  ; depth, see D2
elem      = node / field / item / label
node      = %s"node" [SP (text / %s"empty")]
field     = %s"field" SP string [SP %s"list"] [SP (%s"inline" / %s"embedded")]
item      = text [SP name]
text      = [%s"quoted" SP] string
label     = %s"label" SP string
diag-line = "!" SP code SP position LF
code      = 1*(ALPHA / DIGIT / ".")
range     = "@" position "-" position
position  = 1*DIGIT ":" 1*DIGIT
name      = 1*(ALPHA / DIGIT / "_" / "-" / %x80-10FFFF)
string    = DQUOTE *(unescaped / escape) DQUOTE
escape    = "\" (DQUOTE / "\" / %x62 / %x66 / %x6E / %x72 / %x74
            / %x75 4(DIGIT / %x61-66))
unescaped = %x20-21 / %x23-5B / %x5D-10FFFF  ; minus what C47 escapes

A6. Examples

These examples are tests (part B).

client:: Acme; Globex
tags:: a;;b;
contact::
→primary:: anna
matrix::
→;
→→x
::
```csv
a,b
.
root
  field "client"
    "Acme"
    "Globex"
  field "tags"
    "a"
    "b"
  field "contact"
    node
      field "primary"
        "anna"
  field "matrix"
    node ";"
      node "x"
  node empty
  node "```csv\na,b"
! C29 9:1
- [x] Send draft to [[Anna]] +task [due:: 2026-10-10]
site:: https://example.com
.
root
  node "- [x] Send draft to [[Anna]] +task [due:: 2026-10-10]" @1:1-1:54
    label "Send draft to [[Anna]]"
    field "_state" inline @1:3-1:6
      "done" @1:4-1:5
    field "_link" embedded @1:21-1:29
      "[[Anna]]" @1:21-1:29
    field "_types" inline @1:30-1:35
      "task" @1:31-1:35
    field "due" inline @1:36-1:54
      "2026-10-10" date @1:43-1:53
  field "site" @2:1-2:27
    "https://example.com" _url @2:8-2:27

B. Tests

The examples in the specs are tests. A script extracts them and runs them against an implementation.

Source: Test_format.md in ordlang/ord, licensed under CC BY 4.0.