From a1aa2b791511e172b177516e7f58390a2d074a2b Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 8 Jan 2009 10:30:14 -0500 Subject: Injected a non-special-case datatype --- tests/jsinj.ur | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/jsinj.ur') diff --git a/tests/jsinj.ur b/tests/jsinj.ur index f3954085..182de33b 100644 --- a/tests/jsinj.ur +++ b/tests/jsinj.ur @@ -20,6 +20,16 @@ fun delist ls : xbody = Nil => Nil | Cons (h, t) => {cdata h} :: {delist t} +datatype weird = Foo | Bar | Baz of string + +fun weirdToString w = + case w of + Foo => "Foo" + | Bar => "Bar" + | Baz s => s + +val show_weird = mkShow weirdToString + cookie int : int cookie float : float cookie string : string @@ -28,6 +38,7 @@ cookie pair : int * float cookie option : option int cookie color : color cookie list : list string +cookie weird : weird fun main () : transaction page = n <- getCookie int; @@ -62,6 +73,10 @@ fun main () : transaction page = l <- return (getOpt l (Cons ("A", Cons ("B", Nil)))); sl <- source Nil; + w <- getCookie weird; + w <- return (getOpt w (Baz "TADA!")); + sw <- source Foo; + return {[n]}}/> CHANGE
@@ -88,4 +103,7 @@ fun main () : transaction page = {delist l}}/> CHANGE
+ + {[w]}}/> + CHANGE
-- cgit v1.2.3