aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2016-05-15 09:47:49 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2016-05-15 09:47:49 -0400
commitd6453242560cfeaa31e74b2c77423b4ada288ac6 (patch)
tree1f28ac4db0a476a21e4234c38e19eb8ae8edf666 /tests
parenta0686c30f1315a6ca8c10acfca386df468f172a8 (diff)
Support for <meta> tags
Diffstat (limited to 'tests')
-rw-r--r--tests/meta.ur48
-rw-r--r--tests/meta.urp4
2 files changed, 52 insertions, 0 deletions
diff --git a/tests/meta.ur b/tests/meta.ur
new file mode 100644
index 00000000..f8d12183
--- /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 &lt;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 &lt;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 &lt;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
diff --git a/tests/meta.urp b/tests/meta.urp
new file mode 100644
index 00000000..95ede782
--- /dev/null
+++ b/tests/meta.urp
@@ -0,0 +1,4 @@
+rewrite all Meta/*
+allow meta viewport
+
+meta