aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/cookieClear.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-02-10 08:46:46 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2011-02-10 08:46:46 -0500
commitf45895094211495b2aec63541b97e61b71abf289 (patch)
tree189de6f2ff8814313cf52d2fafc2a2d266806c26 /tests/cookieClear.ur
parent7db27b06d50316f07bb38ddc5999d086be911ed2 (diff)
Fix some cookie-related bugs in MonoReduce
Diffstat (limited to 'tests/cookieClear.ur')
-rw-r--r--tests/cookieClear.ur19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/cookieClear.ur b/tests/cookieClear.ur
new file mode 100644
index 00000000..70829808
--- /dev/null
+++ b/tests/cookieClear.ur
@@ -0,0 +1,19 @@
+cookie c : int
+
+fun setit () =
+ setCookie c {Value = 13,
+ Expires = None,
+ Secure = False};
+ return <xml/>
+
+fun doit () =
+ ro <- getCookie c;
+ clearCookie c;
+ case ro of
+ None => return <xml>None</xml>
+ | Some v => return <xml>Some {[v]}</xml>
+
+fun main () = return <xml><body>
+ <form><submit value="Set it!" action={setit}/></form>
+ <form><submit value="Get busy!" action={doit}/></form>
+</body></xml>