diff options
Diffstat (limited to 'tests/space_comb.js')
-rw-r--r-- | tests/space_comb.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/space_comb.js b/tests/space_comb.js new file mode 100644 index 0000000..1cde721 --- /dev/null +++ b/tests/space_comb.js @@ -0,0 +1,24 @@ +// Tests space.comb() + +const Space = require('../space'); + +newspace = new Space(); +newspace.adhoc('\ +line1\n\ +&&&&transparency&&&&\n\ +\n\ +afterempty\n') + +otherspace = new Space(); +otherspace.adhoc('\ +&&&transparency&&&\n\ +testline'); + +function add(char1,char2){ + if (char1 == '') return char2; + else return char1; +} + +otherspace.comb(newspace, add, [0,0]); + +console.log(otherspace.print()); |