Permalink
Browse files

Test and fix missing operation in net merging.

  • Loading branch information...
1 parent 2f8b839 commit f9c90d5bee1905bdecdcda2b849b656e98621e08 @kpreid committed Jul 10, 2012
Showing with 16 additions and 0 deletions.
  1. +1 −0 circuit.js
  2. +15 −0 test/test-circuits.js
View
@@ -226,6 +226,7 @@
net1.forEach(function (record) {
var block = record[0];
var direction = record[1];
+ net2.push(record);
cGraph[block][direction] = net2;
});
net1.edges.forEach(function (edgeRecord) {
View
@@ -426,4 +426,19 @@ describe("Circuit", function() {
expect(t.world.gSub(0, 1, 0)).toEqual(1);
expect(t.world.gSub(0, 1, 1)).toEqual(1);
});
+
+ it("should merge nets which meet (#2)", function () {
+ // TODO more testing of same - see previous spec's comments
+ t.world.s(0, 0, 0, t.ls.indicator);
+ t.world.s(0, 0, 1, t.ls.junction);
+ t.world.s(0, 0, 2, t.ls.junction);
+ t.world.s(0, 0, 3, t.ls.junction);
+ t.world.s(0, 1, 1, t.ls.constant, 0);
+ t.world.s(0, 1, 2, t.ls.constant, 0);
+ //Circuit.setDebugLogging(true);
+ t.world.s(0, 1, 3, t.ls.constant, 1);
+ //Circuit.setDebugLogging(false);
+
+ expect(t.world.gSub(0, 0, 0)).toEqual(1);
+ });
});

0 comments on commit f9c90d5

Please sign in to comment.