]> gitweb.factorcode.org Git - factor.git/commitdiff
path-finding: add test for abeaumont's fix.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 27 Aug 2011 02:58:07 +0000 (19:58 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 27 Aug 2011 02:58:07 +0000 (19:58 -0700)
extra/path-finding/path-finding-tests.factor

index 0e9b5289b11a3de262f07aaa0a18f3333f42cda1..6c20104fe1884a570936f30fd0599b66f9493887 100644 (file)
@@ -138,3 +138,13 @@ MEMO: costs ( -- costs )
 
 ! No path from D to B -- all nodes reachable from D must have been examined
 [ f "CDEF" ] [ "DB" test3 ] unit-test
+
+[ { 1 3 } ] [
+    1 3 H{
+        { 1 H{ { 2 0 } { 3 0 } } }
+        { 2 H{ { 3 0 } { 1 0 } { 4 0 } } }
+        { 3 H{ { 4 0 } } }
+        { 4 H{ } }
+    } <dijkstra> find-path
+] unit-test
+