Private beta, by invitation. It may change without warning. While the beta lasts, some paid features are free. See pricing

trumlyspec GitHub
Try trumly

Conformance cases /

names-pack-depth

Tests one part of the structure checks.

Our implementation passes this case when its check --json output for the input below equals the expected output.

Input

nodes/a--pack.md
---
id: a--pack
type: pack
fields: {"name": "a", "version": "1.0.0", "pack": "a@1.0.0", "requires": ["b@^1", "d@^1"]}
---
nodes/a--rule-thing.md
---
id: a--rule-thing
type: rule
fields: {"applies_to": {"type": "thing"}, "check": {"require_fields": ["x"]}, "severity": "warn", "pack": "a@1.0.0"}
---
nodes/a--rule-widget.md
---
id: a--rule-widget
type: rule
fields: {"applies_to": {"type": "widget"}, "check": {"require_fields": ["x"]}, "severity": "warn", "pack": "a@1.0.0"}
---
nodes/b--pack.md
---
id: b--pack
type: pack
fields: {"name": "b", "version": "1.0.0", "pack": "b@1.0.0", "requires": ["c@^1"]}
---
nodes/b--type-thing.md
---
id: b--type-thing
type: type
fields: {"name": "thing", "pack": "b@1.0.0"}
---
nodes/b--type-widget.md
---
id: b--type-widget
type: type
fields: {"name": "widget", "pack": "b@1.0.0"}
---
nodes/c--pack.md
---
id: c--pack
type: pack
fields: {"name": "c", "version": "1.0.0", "pack": "c@1.0.0"}
---
nodes/c--type-thing.md
---
id: c--type-thing
type: type
fields: {"name": "thing", "pack": "c@1.0.0"}
---
nodes/d--pack.md
---
id: d--pack
type: pack
fields: {"name": "d", "version": "1.0.0", "pack": "d@1.0.0"}
---
nodes/d--type-widget.md
---
id: d--type-widget
type: type
fields: {"name": "widget", "pack": "d@1.0.0"}
---
nodes/e--pack.md
---
id: e--pack
type: pack
fields: {"name": "e", "version": "1.0.0", "pack": "e@1.0.0"}
---
nodes/e--rule-gadget.md
---
id: e--rule-gadget
type: rule
fields: {"applies_to": {"type": "gadget"}, "check": {"require_fields": ["x"]}, "severity": "warn", "pack": "e@1.0.0"}
---
nodes/e--rule-gizmo.md
---
id: e--rule-gizmo
type: rule
fields: {"applies_to": {"type": "gizmo"}, "check": {"require_fields": ["x"]}, "severity": "warn", "pack": "e@1.0.0"}
---
nodes/f--pack.md
---
id: f--pack
type: pack
fields: {"name": "f", "version": "1.0.0", "pack": "f@1.0.0"}
---
nodes/f--type-gadget.md
---
id: f--type-gadget
type: type
fields: {"name": "gadget", "pack": "f@1.0.0"}
---
nodes/f--type-gizmo.md
---
id: f--type-gizmo
type: type
fields: {"name": "gizmo", "pack": "f@1.0.0"}
---
nodes/g--pack.md
---
id: g--pack
type: pack
fields: {"name": "g", "version": "1.0.0", "pack": "g@1.0.0"}
---
nodes/g--type-gadget.md
---
id: g--type-gadget
type: type
fields: {"name": "gadget", "pack": "g@1.0.0"}
---
nodes/n-b-thing.md
---
id: n-b-thing
type: b:thing
fields: {"x": 1}
---
nodes/n-c-thing.md
---
id: n-c-thing
type: c:thing
fields: {"x": 1}
---
nodes/n-f-gizmo.md
---
id: n-f-gizmo
type: f:gizmo
fields: {"x": 1}
---

Expected output

0 ghosts · 0 load errors · 21 nodes · 2 results

expected.json
{
 "ghosts": [],
 "load_errors": [],
 "nodes": [
  {
   "body": "",
   "fields": {
    "name": "a",
    "pack": "a@1.0.0",
    "requires": [
     "b@^1",
     "d@^1"
    ],
    "version": "1.0.0"
   },
   "id": "a--pack",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "a--pack",
   "type": "pack"
  },
  {
   "body": "",
   "fields": {
    "applies_to": {
     "type": "thing"
    },
    "check": {
     "require_fields": [
      "x"
     ]
    },
    "pack": "a@1.0.0",
    "severity": "warn"
   },
   "id": "a--rule-thing",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "a--rule-thing",
   "type": "rule"
  },
  {
   "body": "",
   "fields": {
    "applies_to": {
     "type": "widget"
    },
    "check": {
     "require_fields": [
      "x"
     ]
    },
    "pack": "a@1.0.0",
    "severity": "warn"
   },
   "id": "a--rule-widget",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "a--rule-widget",
   "type": "rule"
  },
  {
   "body": "",
   "fields": {
    "name": "b",
    "pack": "b@1.0.0",
    "requires": [
     "c@^1"
    ],
    "version": "1.0.0"
   },
   "id": "b--pack",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "b--pack",
   "type": "pack"
  },
  {
   "body": "",
   "fields": {
    "name": "thing",
    "pack": "b@1.0.0"
   },
   "id": "b--type-thing",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "b--type-thing",
   "type": "type"
  },
  {
   "body": "",
   "fields": {
    "name": "widget",
    "pack": "b@1.0.0"
   },
   "id": "b--type-widget",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "b--type-widget",
   "type": "type"
  },
  {
   "body": "",
   "fields": {
    "name": "c",
    "pack": "c@1.0.0",
    "version": "1.0.0"
   },
   "id": "c--pack",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "c--pack",
   "type": "pack"
  },
  {
   "body": "",
   "fields": {
    "name": "thing",
    "pack": "c@1.0.0"
   },
   "id": "c--type-thing",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "c--type-thing",
   "type": "type"
  },
  {
   "body": "",
   "fields": {
    "name": "d",
    "pack": "d@1.0.0",
    "version": "1.0.0"
   },
   "id": "d--pack",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "d--pack",
   "type": "pack"
  },
  {
   "body": "",
   "fields": {
    "name": "widget",
    "pack": "d@1.0.0"
   },
   "id": "d--type-widget",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "d--type-widget",
   "type": "type"
  },
  {
   "body": "",
   "fields": {
    "name": "e",
    "pack": "e@1.0.0",
    "version": "1.0.0"
   },
   "id": "e--pack",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "e--pack",
   "type": "pack"
  },
  {
   "body": "",
   "fields": {
    "applies_to": {
     "type": "gadget"
    },
    "check": {
     "require_fields": [
      "x"
     ]
    },
    "pack": "e@1.0.0",
    "severity": "warn"
   },
   "id": "e--rule-gadget",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "e--rule-gadget",
   "type": "rule"
  },
  {
   "body": "",
   "fields": {
    "applies_to": {
     "type": "gizmo"
    },
    "check": {
     "require_fields": [
      "x"
     ]
    },
    "pack": "e@1.0.0",
    "severity": "warn"
   },
   "id": "e--rule-gizmo",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "e--rule-gizmo",
   "type": "rule"
  },
  {
   "body": "",
   "fields": {
    "name": "f",
    "pack": "f@1.0.0",
    "version": "1.0.0"
   },
   "id": "f--pack",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "f--pack",
   "type": "pack"
  },
  {
   "body": "",
   "fields": {
    "name": "gadget",
    "pack": "f@1.0.0"
   },
   "id": "f--type-gadget",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "f--type-gadget",
   "type": "type"
  },
  {
   "body": "",
   "fields": {
    "name": "gizmo",
    "pack": "f@1.0.0"
   },
   "id": "f--type-gizmo",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "f--type-gizmo",
   "type": "type"
  },
  {
   "body": "",
   "fields": {
    "name": "g",
    "pack": "g@1.0.0",
    "version": "1.0.0"
   },
   "id": "g--pack",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "g--pack",
   "type": "pack"
  },
  {
   "body": "",
   "fields": {
    "name": "gadget",
    "pack": "g@1.0.0"
   },
   "id": "g--type-gadget",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "g--type-gadget",
   "type": "type"
  },
  {
   "body": "",
   "fields": {
    "x": 1
   },
   "id": "n-b-thing",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "n-b-thing",
   "type": "b:thing"
  },
  {
   "body": "",
   "fields": {
    "x": 1
   },
   "id": "n-c-thing",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "n-c-thing",
   "type": "c:thing"
  },
  {
   "body": "",
   "fields": {
    "x": 1
   },
   "id": "n-f-gizmo",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "n-f-gizmo",
   "type": "f:gizmo"
  }
 ],
 "results": [
  {
   "node": "n-b-thing",
   "rule": "a--rule-thing",
   "severity": "warn",
   "status": "pass"
  },
  {
   "node": "n-f-gizmo",
   "rule": "e--rule-gizmo",
   "severity": "warn",
   "status": "pass"
  }
 ],
 "structure": {
  "errors": [],
  "warnings": [
   {
    "kind": "ambiguous_type",
    "node": "a--rule-widget",
    "ref": "widget"
   },
   {
    "kind": "ambiguous_type",
    "node": "e--rule-gadget",
    "ref": "gadget"
   }
  ]
 }
}