mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 20:59:10 +00:00
fix(std/encoding/toml): Comment after arrays causing incorrect output (#7224)
This commit is contained in:
parent
935c92800f
commit
03a3256e9c
4 changed files with 128 additions and 32 deletions
|
@ -413,3 +413,30 @@ the = "array"
|
|||
assertEquals(actual, expected);
|
||||
},
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "[TOML] Comments",
|
||||
fn: () => {
|
||||
const expected = {
|
||||
str0: "value",
|
||||
str1: "# This is not a comment",
|
||||
str2:
|
||||
" # this is not a comment!\nA multiline string with a #\n# this is also not a comment",
|
||||
str3:
|
||||
'"# not a comment"\n\t# this is a real tab on purpose \n# not a comment',
|
||||
point0: { x: 1, y: 2, str0: "#not a comment", z: 3 },
|
||||
point1: { x: 7, y: 8, z: 9, str0: "#not a comment" },
|
||||
deno: {
|
||||
features: ["#secure by default", "supports typescript # not a comment"],
|
||||
url: "https://deno.land/",
|
||||
is_not_node: true,
|
||||
},
|
||||
toml: {
|
||||
name: "Tom's Obvious, Minimal Language",
|
||||
objectives: ["easy to read", "minimal config file", "#not a comment"],
|
||||
},
|
||||
};
|
||||
const actual = parseFile(path.join(testFilesDir, "comment.toml"));
|
||||
assertEquals(actual, expected);
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue