summaryrefslogtreecommitdiff
path: root/tests/redirect.ur
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/redirect.ur
parentb084552dfb0f1878ef6ad7319dfe728b887d2bd0 (diff)
Basis.url and redirects
Diffstat (limited to 'tests/redirect.ur')
-rw-r--r--tests/redirect.ur15
1 files changed, 15 insertions, 0 deletions
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>