diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/url.ur | 9 | ||||
-rw-r--r-- | tests/url.urp | 3 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/url.ur b/tests/url.ur index c45681e0..ea236502 100644 --- a/tests/url.ur +++ b/tests/url.ur @@ -1,12 +1,11 @@ -val url = "http://www.yahoo.com/" - fun readersChoice r = return <xml><body> - <a href={bless r.Url}>Your pick, boss</a> + {case checkUrl r.Url of + None => <xml>I can't do that, Dave.</xml> + | Some url => <xml><a href={url}>Your pick, boss</a></xml>} </body></xml> fun main () : transaction page = return <xml><body> - <a href="http://www.google.com/">Google!</a> - <a href={bless url}>Yahoo!</a><br/> + <a href="http://en.wikipedia.org/wiki/Wikipedia:About">Learn</a> <br/> <form><textbox{#Url}/> <submit action={readersChoice}/></form> diff --git a/tests/url.urp b/tests/url.urp index ab5ec1b7..aaa84900 100644 --- a/tests/url.urp +++ b/tests/url.urp @@ -1,4 +1,5 @@ debug -allow url http://* +deny url http://en.wikipedia.org/wiki/Perl +allow url http://en.wikipedia.org/* url |