aboutsummaryrefslogtreecommitdiff
path: root/tests/comb.js
blob: 3ba3a15ef66a67f8a22ec5b645ecc64623401f2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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());