summaryrefslogtreecommitdiff
path: root/tests/redirect.ur
diff options
context:
space:
mode:
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>