« get me outta code hell

validators, test: don't include line break in surroundings - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-01-06 13:21:18 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-01-06 13:21:47 -0400
commitce2eb1e09acdd5adb8a35485ccf635a73b84e5b9 (patch)
treebfd1331007684d6a025e0af99da92721eab347c1 /test
parent5b4510abf439f263ceccea729e9f45af146758da (diff)
validators, test: don't include line break in surroundings
Diffstat (limited to 'test')
-rw-r--r--test/unit/data/things/validators.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/unit/data/things/validators.js b/test/unit/data/things/validators.js
index fd86c131..11134a90 100644
--- a/test/unit/data/things/validators.js
+++ b/test/unit/data/things/validators.js
@@ -168,7 +168,7 @@ t.test('isCommentary', t => {
 });
 
 t.test('isContentString', t => {
-  t.plan(11);
+  t.plan(12);
 
   t.ok(isContentString(`Hello, world!`));
   t.ok(isContentString(`Hello...\nWorld!`));
@@ -210,6 +210,19 @@ t.test('isContentString', t => {
     ]));
 
   quickThrows(
+    `It's go-\u200bin',\n` +
+    `\u200bIt's goin',\u200b\n` +
+    `\u200b\u200bIt's going!`,
+    new AggregateError([
+      new AggregateError([
+        new TypeError(`Delete "\u200b" (zero-width space) between "go-" and "in'" (line: 1, col: 9)`),
+        new TypeError(`Delete "\u200b" (zero-width space) before "It'" (line: 2, col: 1)`),
+        new TypeError(`Delete "\u200b" (zero-width space) after "n'," (line: 2, col: 13)`),
+        new TypeError(`Delete "\u200b\u200b" (zero-width space) before "It'" (line: 3, col: 1)`),
+      ]),
+    ]));
+
+  quickThrows(
     `  Room at the start.`,
     new AggregateError([
       new AggregateError([