parent-chain-missing
Tests the parent chain and the findings for broken or cyclic parents.
Our implementation passes this case when its check --json output for the input below equals the expected
output.
Input
nodes/a.md---
id: a
type: t
parent: b
---nodes/b.md---
id: b
type: t
parent: gone
---nodes/r.md---
id: r
type: rule
fields:
statement: s
applies_to: {under: gone}
---Expected output
0 ghosts · 0 load errors · 3 nodes · 0 results
expected.json{
"ghosts": [],
"load_errors": [],
"nodes": [
{
"body": "",
"fields": {},
"id": "a",
"links": [],
"parent": "b",
"plane": null,
"title": "a",
"type": "t"
},
{
"body": "",
"fields": {},
"id": "b",
"links": [],
"parent": "gone",
"plane": null,
"title": "b",
"type": "t"
},
{
"body": "",
"fields": {
"applies_to": {
"under": "gone"
},
"statement": "s"
},
"id": "r",
"links": [],
"parent": null,
"plane": null,
"title": "r",
"type": "rule"
}
],
"results": [],
"structure": {
"errors": [
{
"kind": "missing_parent",
"node": "b",
"ref": "gone"
}
],
"warnings": []
}
}