From: Tim Vieira Date: Fri, 19 Jul 2013 18:44:22 +0000 (-0400) Subject: added test case for issue #52 -- keeping $key up to date. X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=3ffb51166020544e07b0314987796b74945a3c10;p=dyna2 added test case for issue #52 -- keeping $key up to date. --- diff --git a/test/repl/issue52.dynadoc b/test/repl/issue52.dynadoc new file mode 100644 index 0000000..2b60838 --- /dev/null +++ b/test/repl/issue52.dynadoc @@ -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.