summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/contentDisposition.ur4
-rw-r--r--tests/contentDisposition.urp5
-rw-r--r--tests/formLimit.ur11
-rw-r--r--tests/formLimit.urp4
-rw-r--r--tests/formLimit.urs1
-rw-r--r--tests/groupBy.ur3
-rw-r--r--tests/groupBy.urp4
-rw-r--r--tests/meta.ur48
-rw-r--r--tests/meta.urp4
9 files changed, 84 insertions, 0 deletions
diff --git a/tests/contentDisposition.ur b/tests/contentDisposition.ur
new file mode 100644
index 00000000..8fe2b26c
--- /dev/null
+++ b/tests/contentDisposition.ur
@@ -0,0 +1,4 @@
+fun main () : transaction page =
+ setHeader (blessResponseHeader "Content-Disposition")
+ ("attachment; filename=test.txt");
+ returnBlob (textBlob "Hi there!") (blessMime "text/plain")
diff --git a/tests/contentDisposition.urp b/tests/contentDisposition.urp
new file mode 100644
index 00000000..92b02871
--- /dev/null
+++ b/tests/contentDisposition.urp
@@ -0,0 +1,5 @@
+rewrite all ContentDisposition/*
+allow responseHeader Content-Disposition
+allow mime text/plain
+
+contentDisposition \ No newline at end of file
diff --git a/tests/formLimit.ur b/tests/formLimit.ur
new file mode 100644
index 00000000..d591f736
--- /dev/null
+++ b/tests/formLimit.ur
@@ -0,0 +1,11 @@
+fun handler r = return <xml><body>
+ {[r.A]}, {[r.B]}
+</body></xml>
+
+fun main () = return <xml><body>
+ <form>
+ <textbox{#A}/>
+ <textbox{#B}/>
+ <submit action={handler}/>
+ </form>
+</body></xml>
diff --git a/tests/formLimit.urp b/tests/formLimit.urp
new file mode 100644
index 00000000..3fd7e5c3
--- /dev/null
+++ b/tests/formLimit.urp
@@ -0,0 +1,4 @@
+rewrite all FormLimit/*
+limit inputs 1
+
+formLimit
diff --git a/tests/formLimit.urs b/tests/formLimit.urs
new file mode 100644
index 00000000..6ac44e0b
--- /dev/null
+++ b/tests/formLimit.urs
@@ -0,0 +1 @@
+val main : unit -> transaction page
diff --git a/tests/groupBy.ur b/tests/groupBy.ur
new file mode 100644
index 00000000..e91e33cc
--- /dev/null
+++ b/tests/groupBy.ur
@@ -0,0 +1,3 @@
+val main : transaction page = return <xml><body>
+ {[List.groupBy eq (1 :: 1 :: 2 :: 2 :: 3 :: 4 :: 4 :: 4 :: 5 :: [])]}
+</body></xml>
diff --git a/tests/groupBy.urp b/tests/groupBy.urp
new file mode 100644
index 00000000..de1db792
--- /dev/null
+++ b/tests/groupBy.urp
@@ -0,0 +1,4 @@
+rewrite all GroupBy/*
+
+$/list
+groupBy
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