parent-cycle
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: a
---nodes/c.md---
id: c
type: t
parent: a
---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": "a",
"plane": null,
"title": "b",
"type": "t"
},
{
"body": "",
"fields": {},
"id": "c",
"links": [],
"parent": "a",
"plane": null,
"title": "c",
"type": "t"
}
],
"results": [],
"structure": {
"errors": [
{
"kind": "parent_cycle",
"node": "a",
"ref": null
},
{
"kind": "parent_cycle",
"node": "b",
"ref": null
},
{
"kind": "parent_cycle",
"node": "c",
"ref": null
}
],
"warnings": []
}
}