aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHolden Rohrer <holden.rohrer@gmail.com>2019-12-27 02:18:46 -0500
committerHolden Rohrer <holden.rohrer@gmail.com>2019-12-27 14:57:57 -0500
commitd6d52bafb1f7798a937aa57aacc5874f29b0ea8b (patch)
tree83362d0fe4b8e452d98858d25707d85ee25c360d /tests
parent940dcce9582a537b6c1a08dd08e04221b6fcf696 (diff)
added comb.js tests
Diffstat (limited to 'tests')
-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());