summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-12-10 13:32:09 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-12-10 13:32:09 -0500
commit7cfa621d957e18909cddab064955dc2ab6ad54be (patch)
tree0f8fb3c5e3f1278843704633e53f27ec20e49b06 /tests
parentb084552dfb0f1878ef6ad7319dfe728b887d2bd0 (diff)
Basis.url and redirects
Diffstat (limited to 'tests')
-rw-r--r--tests/makeUrl.ur3
-rw-r--r--tests/makeUrl.urp3
-rw-r--r--tests/makeUrl.urs1
-rw-r--r--tests/redirect.ur15
-rw-r--r--tests/redirect.urp4
-rw-r--r--tests/redirect.urs1
6 files changed, 27 insertions, 0 deletions
diff --git a/tests/makeUrl.ur b/tests/makeUrl.ur
new file mode 100644
index 00000000..12026dab
--- /dev/null
+++ b/tests/makeUrl.ur
@@ -0,0 +1,3 @@
+fun other () = return <xml>Hi!</xml>
+
+fun main () = return <xml>{[Basis.url (main ())]}, {[url (other ())]}</xml>
diff --git a/tests/makeUrl.urp b/tests/makeUrl.urp
new file mode 100644
index 00000000..83451c4c
--- /dev/null
+++ b/tests/makeUrl.urp
@@ -0,0 +1,3 @@
+debug
+
+makeUrl
diff --git a/tests/makeUrl.urs b/tests/makeUrl.urs
new file mode 100644
index 00000000..6ac44e0b
--- /dev/null
+++ b/tests/makeUrl.urs
@@ -0,0 +1 @@
+val main : unit -> transaction page
diff --git a/tests/redirect.ur b/tests/redirect.ur
new file mode 100644
index 00000000..da5114ca
--- /dev/null
+++ b/tests/redirect.ur
@@ -0,0 +1,15 @@
+fun other () = redirect (bless "http://www.google.com/")
+
+fun further () = case checkUrl "http://www.google.com/" of
+ None => return <xml>Darn.</xml>
+ | Some url => redirect url
+
+fun failing () = case checkUrl "http://www.yahoo.com/" of
+ None => return <xml>Darn.</xml>
+ | Some url => redirect url
+
+fun main () = return <xml><body>
+ <a link={other ()}>Go there</a><br/>
+ <a link={further ()}>Go also there</a><br/>
+ <a link={failing ()}>Fail there</a>
+</body></xml>
diff --git a/tests/redirect.urp b/tests/redirect.urp
new file mode 100644
index 00000000..670d3212
--- /dev/null
+++ b/tests/redirect.urp
@@ -0,0 +1,4 @@
+debug
+allow url http://www.google.com/
+
+redirect
diff --git a/tests/redirect.urs b/tests/redirect.urs
new file mode 100644
index 00000000..6ac44e0b
--- /dev/null
+++ b/tests/redirect.urs
@@ -0,0 +1 @@
+val main : unit -> transaction page