test suite test graph
test case basic test()
assert the graph • adjacent("foo") • is empty
the graph • add edge("foo", "bar", "edge")
assert the graph • adjacent("bar") • is empty
foo : the graph • adjacent("foo")
assert !foo • is empty
assert foo • is not empty
assert foo • size == 1
assert foo elements • first == "bar"
test case cycle test()
the graph • add edge("A", "B", "A-B")
the graph • add edge("A", "C", "A-C")
the graph • add edge("C", "D", "C-D")
assert the graph • adjacent("A") • size == 2
assert the graph • adjacent("B") • size == 0
assert the graph • adjacent("C") • size == 1
assert the graph • adjacent("D") • size == 0
assert the graph • introduces cycle("A", "A")
assert !the graph • introduces cycle("A", "B")
assert the graph • introduces cycle("B", "A")
assert !the graph • introduces cycle("B", "C")
assert the graph • introduces cycle("C", "A")
assert the graph • introduces cycle("D", "A")
assert the graph • introduces cycle("D", "C")
assert !the graph • introduces cycle("D", "B")