test: pin the reviewer's exact cyclic-alias example
`&a [1, *a]` puts the self-reference after a plain value, so a guard that only inspected the head of a sequence would miss it. Already caught; this records that it is. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ND46Ci64DC3tzBy9aG81Nc Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
9f288259f5
commit
e5f2fdbb4f
1 changed files with 8 additions and 0 deletions
|
|
@ -147,6 +147,14 @@ describe("parseSkillFrontmatter (#2248)", () => {
|
|||
expect(parsed).toEqual({ error: expect.stringContaining("cyclic") });
|
||||
});
|
||||
|
||||
it("rejects a cycle that is not the first element", () => {
|
||||
// `&a [1, *a]` — the self-reference sits after a plain value, so a guard
|
||||
// that only inspected the head of a sequence would miss it.
|
||||
expect(parseSkillFrontmatter("a: &a [1, *a]")).toEqual({
|
||||
error: expect.stringContaining("cyclic"),
|
||||
});
|
||||
});
|
||||
|
||||
it("rejects a cycle through a mapping, not only an array", () => {
|
||||
expect(parseSkillFrontmatter("a: &a\n self: *a")).toEqual({
|
||||
error: expect.stringContaining("cyclic"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue