Mercurial > urweb
diff tests/parseInt.ur @ 1630:4798ad652c94
Stop [read] from raising an exception for invalid [int] strings
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sun, 04 Dec 2011 15:13:53 -0500 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/parseInt.ur Sun Dec 04 15:13:53 2011 -0500 @@ -0,0 +1,9 @@ +fun main () : transaction page = + s <- source ""; + return <xml><body> + <ctextbox source={s}/> + <button onclick={n <- get s; + case read n of + None => alert "Invalid" + | Some n => alert (show (n + 1))}/> + </body></xml>