diff options
Diffstat (limited to 'tests/cookie.ur')
-rw-r--r-- | tests/cookie.ur | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/cookie.ur b/tests/cookie.ur new file mode 100644 index 0000000..bef45a4 --- /dev/null +++ b/tests/cookie.ur @@ -0,0 +1,22 @@ +cookie c : string + +fun other () = + so <- getCookie c; + case so of + None => return <xml>No cookie</xml> + | Some s => return <xml>Cookie: {[s]}</xml> + +structure M = struct + fun aux () = + setCookie c "Hi"; + so <- getCookie c; + case so of + None => return <xml>No cookie</xml> + | Some s => return <xml><body>Cookie: {[s]}<br/> + <a link={other ()}>Other</a></body></xml> +end + +fun main () : transaction page = return <xml><body> + <a link={other ()}>Other</a><br/> + <a link={M.aux ()}>Aux</a><br/> +</body></xml> |