aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/comb.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/comb.js b/tests/comb.js
new file mode 100644
index 0000000..3ba3a15
--- /dev/null
+++ b/tests/comb.js
@@ -0,0 +1,24 @@
+// Tests the utils/comb.js helper functions in conjuction with Space.comb (and .copy)
+
+const Space = require('../space');
+const comb = require('../utils/comb');
+
+let base = new Space();
+base.adhoc('\
+this is some text\n\
+this is the SEARCHSTRING\n\
+&&&&&&&&&&&&&&&&&&&&&&&&\n\
+empty&chars&&&&&&\n');
+base.loc = [0,0];
+
+let mod = base.copy()
+let bg = new Space();
+bg.adhoc('&&trial'); bg.loc = [2,0];
+mod.comb(bg, comb.mask);
+console.log(mod.print());
+
+mod = base.copy()
+bg.loc = [1,0];
+mod.comb(bg, comb.unmask);
+console.log('-----');
+console.log(mod.print());