From a1c70841c1b18e8dec1826478c670891d14f413d Mon Sep 17 00:00:00 2001 From: krasimir Date: Sun, 7 Feb 2010 22:22:30 +0000 Subject: [PATCH] test case for lazy evaluation in the abstract syntax --- testsuite/runtime/eval/lazy.gf | 15 +++++++++++++++ testsuite/runtime/eval/lazy.gfs | 2 ++ testsuite/runtime/eval/lazy.gfs.gold | 2 ++ 3 files changed, 19 insertions(+) create mode 100644 testsuite/runtime/eval/lazy.gf create mode 100644 testsuite/runtime/eval/lazy.gfs create mode 100644 testsuite/runtime/eval/lazy.gfs.gold diff --git a/testsuite/runtime/eval/lazy.gf b/testsuite/runtime/eval/lazy.gf new file mode 100644 index 000000000..51e230b3c --- /dev/null +++ b/testsuite/runtime/eval/lazy.gf @@ -0,0 +1,15 @@ +abstract lazy = { + +cat Nat ; +data zero : Nat ; + succ : Nat -> Nat ; + +fun infinity : Nat ; +def infinity = succ infinity ; + +fun min : Nat -> Nat -> Nat ; +def min zero _ = zero ; + min _ zero = zero ; + min (succ x) (succ y) = succ (min x y) ; + +} \ No newline at end of file diff --git a/testsuite/runtime/eval/lazy.gfs b/testsuite/runtime/eval/lazy.gfs new file mode 100644 index 000000000..b05e3a4b0 --- /dev/null +++ b/testsuite/runtime/eval/lazy.gfs @@ -0,0 +1,2 @@ +i -src testsuite/runtime/eval/lazy.gf +pt -compute min infinity (succ (succ (succ zero))) \ No newline at end of file diff --git a/testsuite/runtime/eval/lazy.gfs.gold b/testsuite/runtime/eval/lazy.gfs.gold new file mode 100644 index 000000000..6b97546b4 --- /dev/null +++ b/testsuite/runtime/eval/lazy.gfs.gold @@ -0,0 +1,2 @@ +succ (succ (succ zero)) +