summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-12-03 11:56:15 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-12-03 11:56:15 -0500
commit4eb3dd414d20ad9140f999b962a1cc674ee22036 (patch)
treea3082108bb32ba616436bdcb7a00b7cd48b391b7 /tests
parent2304eece8f5f2b9067cd66d860a332f8721c5321 (diff)
parent8b892b4ceaaaab751a68edc8fd01ecd2246d3dab (diff)
Merge
Diffstat (limited to 'tests')
-rw-r--r--tests/vlad3.ur27
-rw-r--r--tests/vlad3.urp2
-rw-r--r--tests/vlad3.urs1
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/vlad3.ur b/tests/vlad3.ur
new file mode 100644
index 00000000..3d1e812b
--- /dev/null
+++ b/tests/vlad3.ur
@@ -0,0 +1,27 @@
+cookie user : {EMail : string}
+
+fun main () =
+ ro <- getCookie user;
+ case ro of
+ Some u => welcome u
+ | _ => login ()
+
+and welcome u = return <xml><body>
+ Welcome {[u.EMail]}. <a link={logout ()}>Logout</a>
+</body></xml>
+
+and logout () =
+ clearCookie user;
+ main ()
+
+and login () = return <xml><body>
+ <form>E-mail:<textbox{#EMail}/><submit action={signin}/></form>
+</body></xml>
+
+and signin r =
+ setCookie user {Value = {EMail = r.EMail},
+ Expires = None, (* Some (readError "2012-11-6
+00:00:00"), *)
+ Secure = False
+ };
+ main ()
diff --git a/tests/vlad3.urp b/tests/vlad3.urp
new file mode 100644
index 00000000..3a0fa1f3
--- /dev/null
+++ b/tests/vlad3.urp
@@ -0,0 +1,2 @@
+
+vlad3
diff --git a/tests/vlad3.urs b/tests/vlad3.urs
new file mode 100644
index 00000000..6ac44e0b
--- /dev/null
+++ b/tests/vlad3.urs
@@ -0,0 +1 @@
+val main : unit -> transaction page