Skip to content

Commit

Permalink
Add test for adding nodes with edge keys
Browse files Browse the repository at this point in the history
  • Loading branch information
cpettitt committed Sep 24, 2014
1 parent b97dd7e commit 7472bbf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/graph-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,23 @@ describe("Graph", function() {
expect(g.edgeCount()).to.equal(0);
});

it("allows multi-edges to be created in a multigraph", function() {
it("allows multi-edges to be created in a multigraph #1", function() {
var g = new Graph({ multigraph: true });
g.edge("a", "b", "foo");
g.edge("a", "b", "bar");
expect(g.hasEdge("a", "b", "foo")).to.be.true;
expect(g.hasEdge("a", "b", "bar")).to.be.true;
expect(g.edgeCount()).to.equal(2);
});

it("allows multi-edges to be created in a multigraph #2", function() {
var g = new Graph({ multigraph: true });
g.edge(g.edgeKey("a", "b", "foo"));
g.edge(g.edgeKey("a", "b", "bar"));
expect(g.hasEdge("a", "b", "foo")).to.be.true;
expect(g.hasEdge("a", "b", "bar")).to.be.true;
expect(g.edgeCount()).to.equal(2);
});
});

describe("removeEdge", function() {
Expand Down

0 comments on commit 7472bbf

Please sign in to comment.