add crossing_way validation

Tests are also added and passed.

One thing to note: I had to add the tree() function to history so that I can
use the tree in the test; hope that's fine.
This commit is contained in:
Xiaoming Gao
2018-12-19 17:16:52 -05:00
parent 2207a6c3a4
commit a4e1012c91
8 changed files with 289 additions and 9 deletions
+6 -1
View File
@@ -122,6 +122,11 @@ export function coreHistory(context) {
},
tree: function() {
return _tree;
},
base: function() {
return _stack[0].graph;
},
@@ -285,7 +290,7 @@ export function coreHistory(context) {
return _flatten(_map(
validations,
function(fn) {
return fn(context)(changes, _stack[_index].graph);
return fn(context)(changes, _stack[_index].graph, _tree);
}
));
},