var test = require("tape") , top = require("../topology.js"); function arr_equals(t, a, b) { console.log(a, "---", b); t.equals(a.length, b.length, "length match"); for(var i=0; i 0); t.equals(tris[idx][0], 4); t.equals(tris[idx][1], 5); t.equals(tris[idx][2], 6); //Test lower extreme t.equals(top.findCell(tris, [0], true), 0); //Test upper extreme t.equals(top.findCell(tris, [6,7,8]), tris.length-1); t.end(); }); test("buildIndex", function(t) { var from_cells = top.normalize([ [0,1], [0,2], [1,2], [1,3], [2,3] ]); var to_cells = top.normalize([ [0,1,2], [0,1,3], [0,2,3], [1,2,3] ]); var index = top.incidence(from_cells, to_cells); t.equals(index.length, from_cells.length); console.log(from_cells, to_cells); for(var i=0; i