]> gitweb.factorcode.org Git - factor.git/blob - extra/digraphs/digraphs-tests.factor
Revert "Fixes #2966"
[factor.git] / extra / digraphs / digraphs-tests.factor
1 USING: digraphs kernel sequences tools.test ;
2 IN: digraphs.tests
3
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 ;
10
11 { 5 } [ test-digraph topological-sort length ] unit-test