Skip to content

Commit

Permalink
test(yaml): check the use of reserved characters (#5519)
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k authored Jul 23, 2024
1 parent 7ccb086 commit d6dde6f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions yaml/parse_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1014,3 +1014,16 @@ name: Jane Doe`,
{ name: "Jane Doe", age: 30 },
);
});

Deno.test("parse() throws at reseverd characters '`' and '@'", () => {
assertThrows(
() => parse("`"),
SyntaxError,
"end of the stream or a document separator is expected at line 1, column 1:\n `\n ^",
);
assertThrows(
() => parse("@"),
SyntaxError,
"end of the stream or a document separator is expected at line 1, column 1:\n @\n ^",
);
});

0 comments on commit d6dde6f

Please sign in to comment.