]> hydra-www.ietfng.org Git - dyna2/commitdiff
Add dijkstra example as python selftest
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Tue, 4 Jun 2013 23:50:27 +0000 (19:50 -0400)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Tue, 4 Jun 2013 23:50:27 +0000 (19:50 -0400)
examples/dijkstra.dyna
examples/expected/dijkstra.py.out [new file with mode: 0644]
src/Dyna/Backend/Python/Selftest.hs

index 980afbff0d1d083133a9ddc2a757d2861b052e66..8952c2946205384ca456a03ac5aeb154615ad0d2 100644 (file)
@@ -1,6 +1,6 @@
 
 % Dijkstra's algorithm for single-source shortest path
-path(*start) min= 0 .
+path(start) min= 0 .
 path(B) min= path(A) + edge(A,B).
 
 start := "a".
diff --git a/examples/expected/dijkstra.py.out b/examples/expected/dijkstra.py.out
new file mode 100644 (file)
index 0000000..397415a
--- /dev/null
@@ -0,0 +1,22 @@
+
+Charts
+============
+edge/2
+=================
+edge('a','b')                  := 1
+edge('a','c')                  := 1
+edge('a','d')                  := 3
+edge('b','d')                  := 1
+edge('c','d')                  := 2
+
+path/1
+=================
+path('a')                      := 0
+path('b')                      := 1
+path('c')                      := 1
+path('d')                      := 2
+
+start/0
+=================
+start                          := 'a'
+
index 638ea3d3eac6c2aab5fa067ba41ba393c44e9a57..762c421a22c2af61ce3afce4cca1f78cb04c8b71 100644 (file)
@@ -70,7 +70,7 @@ mkExample name =
 
 goldens :: TF.Test
 goldens = TF.testGroup "Python Backend End-To-End"
-          $ map mkExample ["simple", "papa2", "matrixops"]
+          $ map mkExample ["simple", "dijkstra", "papa2", "matrixops"]
 
 ------------------------------------------------------------------------}}}
 -- Harness toplevel                                                     {{{