]> hydra-www.ietfng.org Git - dyna2/commitdiff
added test case for issue #52 -- keeping $key up to date.
authorTim Vieira <tim.f.vieira@gmail.com>
Fri, 19 Jul 2013 18:44:22 +0000 (14:44 -0400)
committerTim Vieira <tim.f.vieira@gmail.com>
Fri, 19 Jul 2013 18:44:22 +0000 (14:44 -0400)
test/repl/issue52.dynadoc [new file with mode: 0644]

diff --git a/test/repl/issue52.dynadoc b/test/repl/issue52.dynadoc
new file mode 100644 (file)
index 0000000..2b60838
--- /dev/null
@@ -0,0 +1,56 @@
+> pathto(start) min= 0                     with_key [start].
+| pathto(V)     min= pathto(U) + edge(U,V) with_key [V | bestpath(U)].
+| bestpath(U) = $key(pathto(U)).
+| edge(0,1) min= 5.
+| edge(1,2) min= 10.
+
+*ignore*
+
+> start := 0.
+
+Changes
+=======
+$key(pathto(0)) = [0].
+$key(pathto(1)) = [1, 0].
+$key(pathto(2)) = [2, 1, 0].
+bestpath(0) = [0].
+bestpath(1) = [1, 0].
+bestpath(2) = [2, 1, 0].
+pathto(0) = 0.
+pathto(1) = 5.
+pathto(2) = 15.
+start = 0.
+
+
+> start := -1.   % doesn't clear out old keys.
+
+Changes
+=======
+$key(pathto(-1)) = [-1].
+$key(pathto(0)) = null.
+$key(pathto(1)) = null.
+$key(pathto(2)) = null.
+bestpath(-1) = [-1].
+bestpath(0) = null.
+bestpath(1) = null.
+bestpath(2) = null.
+pathto(-1) = 0.
+pathto(0) = null.
+pathto(1) = null.
+pathto(2) = null.
+start = -1.
+
+> start := 1.    % refreshes keys for 1 and 2 but not for -1 and 0.
+
+Changes
+=======
+$key(pathto(-1)) = null.
+$key(pathto(1)) = [1].
+$key(pathto(2)) = [2, 1].
+bestpath(-1) = null.
+bestpath(1) = [1].
+bestpath(2) = [2, 1].
+pathto(-1) = null.
+pathto(1) = 0.
+pathto(2) = 10.
+start = 1.