Fix $or
[factor/jcg.git] / extra / digraphs / digraphs-tests.factor
blob64589c1a9981221170c734d4dccc4475b3d2ab39
1 USING: digraphs kernel sequences tools.test ;
2 IN: digraphs.tests
4 : test-digraph ( -- digraph )
5     <digraph>
6     { { "one" 1 } { "two" 2 } { "three" 3 } { "four" 4 } { "five" 5 } }
7     [ first2 pick add-vertex ] each
8     { { "one" "three" } { "one" "four" } { "two" "three" } { "two" "one" } { "three" "four" } }
9     [ first2 pick add-edge ] each ;
11 [ 5 ] [ test-digraph topological-sort length ] unit-test