From f0ef1608526f5994bacd3ac70dfaac4e3b8cd3dc Mon Sep 17 00:00:00 2001 From: Tim Vieira Date: Fri, 5 Jul 2013 13:14:40 -0400 Subject: [PATCH] added dijkstra-backpointers to end-to-end tests. --- .../expected/dijkstra-backpointers.py.out | 41 +++++++++++++++++++ src/Dyna/Backend/Python/Selftest.hs | 3 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 examples/expected/dijkstra-backpointers.py.out diff --git a/examples/expected/dijkstra-backpointers.py.out b/examples/expected/dijkstra-backpointers.py.out new file mode 100644 index 0000000..1781636 --- /dev/null +++ b/examples/expected/dijkstra-backpointers.py.out @@ -0,0 +1,41 @@ + +Solution +======== +end = "d". +goal = 2. +optimalpath = ["a", "e", "d"]. +start = "a". + +$key/1 +====== +$key(goal) = end. +$key(path("a")) = start. +$key(path("b")) = "a". +$key(path("c")) = "b". +$key(path("d")) = "e". +$key(path("e")) = "a". + +bestpath/1 +========== +bestpath("a") = ["a"]. +bestpath("b") = ["b", "a"]. +bestpath("c") = ["c", "b", "a"]. +bestpath("d") = ["d", "e", "a"]. +bestpath("e") = ["e", "a"]. + +edge/2 +====== +edge("a","b") = 1. +edge("a","e") = 1. +edge("b","c") = 1. +edge("c","d") = 1. +edge("e","d") = 1. + +path/1 +====== +path("a") = 0. +path("b") = 1. +path("c") = 2. +path("d") = 2. +path("e") = 1. + diff --git a/src/Dyna/Backend/Python/Selftest.hs b/src/Dyna/Backend/Python/Selftest.hs index 53e1405..45664a8 100644 --- a/src/Dyna/Backend/Python/Selftest.hs +++ b/src/Dyna/Backend/Python/Selftest.hs @@ -77,7 +77,8 @@ mkExample name = -- will be broken. ;) test_End_To_End :: [Test] test_End_To_End = map mkExample - [ "simple", "equalities", "fib-limit", "dijkstra", "papa2", "matrixops", "geom", "lists" ] + [ "simple", "equalities", "fib-limit", "dijkstra", "papa2", "matrixops" + , "geom", "lists", "dijkstra-backpointers" ] test_REPL :: [Test] test_REPL = map (\n -> testProgramRuns n ("./test/repl/"++n) []) -- 2.50.1