more unit tests

This commit is contained in:
Clément GOUIN
2019-07-11 16:20:30 +02:00
parent e785b471f4
commit 535b9988f7
2 changed files with 115 additions and 2 deletions
+2 -2
View File
@@ -182,7 +182,7 @@ module.exports = (options) => {
let link, src, dst;
//check overlapping
const list = Object.values(nodes);
const list = Object.values(nodes).filter(n => n.x !== undefined);
for (let n1 = 0; n1 < list.length - 1; n1++) {
for (let n2 = n1 + 1; n2 < list.length; n2++) {
if (list[n1].x === list[n2].x && list[n1].y === list[n2].y) {
@@ -224,7 +224,7 @@ module.exports = (options) => {
break;
case 'right':
if (dst.x - src.x <= 0) {
if (self.debug) console.log(` ${link.from} -> ${link.to}: invalid dx; ${dst.x - src.x} <= 0`);
if (self.debug) console.log(` ${link.from} -> ${link.to}: invalid dx: ${dst.x - src.x} <= 0`);
return false;
}
break;