diff options
author | Jakob Strobl <Jakob.Strobl@pitt.edu> | 2020-08-28 18:51:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-28 18:51:06 -0400 |
commit | 03a3256e9c62e38f2b35fa83c35be06fe2123fd2 (patch) | |
tree | 81a625065ce60e8b0f42b7fbb16cb3c2ea13b3ea /std/encoding/toml_test.ts | |
parent | 935c92800f0864c7076cd2e30130fe46fac7e8a5 (diff) |
fix(std/encoding/toml): Comment after arrays causing incorrect output (#7224)
Diffstat (limited to 'std/encoding/toml_test.ts')
-rw-r--r-- | std/encoding/toml_test.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/std/encoding/toml_test.ts b/std/encoding/toml_test.ts index 9b5e1a56b..25c0d1113 100644 --- a/std/encoding/toml_test.ts +++ b/std/encoding/toml_test.ts @@ -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); + }, +}); |