From 3473f0d274fdeaa2a29bfeebacc63a6f5aaaaf9d Mon Sep 17 00:00:00 2001 From: krasimir Date: Wed, 22 Jul 2009 09:53:39 +0000 Subject: [PATCH] added testcase for pattern matching on runtime variables --- testsuite/compiler/check/strMatch/strMatch.gf | 5 +++++ testsuite/compiler/check/strMatch/strMatch.gfs | 2 ++ testsuite/compiler/check/strMatch/strMatchCnc.gf | 8 ++++++++ 3 files changed, 15 insertions(+) create mode 100644 testsuite/compiler/check/strMatch/strMatch.gf create mode 100644 testsuite/compiler/check/strMatch/strMatch.gfs create mode 100644 testsuite/compiler/check/strMatch/strMatchCnc.gf diff --git a/testsuite/compiler/check/strMatch/strMatch.gf b/testsuite/compiler/check/strMatch/strMatch.gf new file mode 100644 index 000000000..c1d2bc4b9 --- /dev/null +++ b/testsuite/compiler/check/strMatch/strMatch.gf @@ -0,0 +1,5 @@ +abstract strMatch = { + cat S ; + fun f : S -> S ; + z : S ; +} \ No newline at end of file diff --git a/testsuite/compiler/check/strMatch/strMatch.gfs b/testsuite/compiler/check/strMatch/strMatch.gfs new file mode 100644 index 000000000..8f039c1de --- /dev/null +++ b/testsuite/compiler/check/strMatch/strMatch.gfs @@ -0,0 +1,2 @@ +i testsuite/compiler/check/strMatch/strMatch.gf +l f z \ No newline at end of file diff --git a/testsuite/compiler/check/strMatch/strMatchCnc.gf b/testsuite/compiler/check/strMatch/strMatchCnc.gf new file mode 100644 index 000000000..c1a21b4af --- /dev/null +++ b/testsuite/compiler/check/strMatch/strMatchCnc.gf @@ -0,0 +1,8 @@ +concrete strMatchCnc of strMatch = open Prelude in { + lincat S = {s : Str; b : Bool} ; + lin f x = case x.s of { + "" => {s="empty"; b=False} ; + _ => x + } ; + lin z = {s=""; b=False} ; +} \ No newline at end of file