summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-12-04 15:13:53 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2011-12-04 15:13:53 -0500
commitcf15b8c2685f7dba7566b9833569cdad078fc429 (patch)
tree13f7dbfad5476e358d258573ba563f0f18451ec4 /tests
parent64adfd7ff1361a1886d689f03b5e30780df9e691 (diff)
Stop [read] from raising an exception for invalid [int] strings
Diffstat (limited to 'tests')
-rw-r--r--tests/parseInt.ur9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/parseInt.ur b/tests/parseInt.ur
new file mode 100644
index 00000000..2d906fc8
--- /dev/null
+++ b/tests/parseInt.ur
@@ -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>