summaryrefslogtreecommitdiff
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
commit98271e4a9f570230175f68417d1aa91f6caf7cd8 (patch)
tree189de6f2ff8814313cf52d2fafc2a2d266806c26 /tests/cookieClear.ur
parent6ac0f0338084612d367def5b8518bd4514c3f9a4 (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>