aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/sbbuilder/test_toml.js
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/modules/sbbuilder/test_toml.js')
-rw-r--r--desktop/modules/sbbuilder/test_toml.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/desktop/modules/sbbuilder/test_toml.js b/desktop/modules/sbbuilder/test_toml.js
index bb230e9..8378519 100644
--- a/desktop/modules/sbbuilder/test_toml.js
+++ b/desktop/modules/sbbuilder/test_toml.js
@@ -86,6 +86,11 @@ assert.strictEqual(T.get(t, "", "state_dir"), 'a "b" \\ c');
assert.strictEqual(T.set("[a]\nx = 1\n\n[b]\nx = 2\n", "b", "x", 3), "[a]\nx = 1\n\n[b]\nx = 3\n");
// A value spanning lines is refused, never duplicated.
assert.throws(() => T.set("o = [\n \"a\",\n]\n", "", "o", ["b"]), /cannot edit/);
+// A value followed by junk is refused too: a multi-line string opens with
+// an empty one, and trailing text is no comment.
+assert.throws(() => T.set('x = """\nabc\n"""\n', "", "x", "n"), /cannot edit/);
+assert.throws(() => T.set('x = "a" junk\n', "", "x", "n"), /cannot edit/);
+assert.strictEqual(T.get('x = "a" junk\n', "", "x"), undefined);
// remove deletes the line outright.
t = T.remove(file, "manifests", "gtk+3");