From d6d52bafb1f7798a937aa57aacc5874f29b0ea8b Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Fri, 27 Dec 2019 02:18:46 -0500 Subject: added comb.js tests --- tests/comb.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/comb.js 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()); -- cgit