diff options
author | Benjamin Barenblat <bbaren@mit.edu> | 2017-07-23 09:50:04 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@mit.edu> | 2017-07-23 09:50:04 -0400 |
commit | 0cccdb0ae595cd7e3e136e984ac7b95b99f71a53 (patch) | |
tree | 491d3b13813610943c60460d3e178d3a73916346 /tests/meta.ur |
Import urweb_20170720+dfsg.orig.tar.gz
[dgit import orig urweb_20170720+dfsg.orig.tar.gz]
Diffstat (limited to 'tests/meta.ur')
-rw-r--r-- | tests/meta.ur | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/meta.ur b/tests/meta.ur new file mode 100644 index 0000000..f8d1218 --- /dev/null +++ b/tests/meta.ur @@ -0,0 +1,48 @@ +fun main () : transaction page = + let + fun handler r = return <xml> + <head> + <meta name={blessMeta r.Nam} content={r.Content}/> + <title>Testing <meta> tags</title> + </head> + <body> + <p>Did it work?</p> + </body> + </xml> + + fun handler2 r = + case checkMeta r.Nam of + None => error <xml>Oh, that name won't do at all.</xml> + | Some name => + return <xml> + <head> + <meta name={name} content={r.Content}/> + <title>Testing <meta> tags</title> + </head> + <body> + <p>Did it work?</p> + </body> + </xml> + in + return <xml> + <head> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <title>Testing <meta> tags</title> + </head> + <body> + <p>Did it work?</p> + + <form> + Name: <textbox{#Nam}/><br/> + Content: <textbox{#Content}/><br/> + <submit action={handler}/> + </form> + + <form> + Name: <textbox{#Nam}/><br/> + Content: <textbox{#Content}/><br/> + <submit action={handler2}/> + </form> + </body> + </xml> + end |