aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/fromString.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-09-07 11:33:13 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-09-07 11:33:13 -0400
commit5cf1d4d086475575a31f57413c57c22bd6fda378 (patch)
treeab36ce67d2931f2c715b5b734930139c53adc670 /tests/fromString.ur
parent42c284b9204ef5dfc249cc7273ff2eaa9304e9e6 (diff)
Converting string to int
Diffstat (limited to 'tests/fromString.ur')
-rw-r--r--tests/fromString.ur10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/fromString.ur b/tests/fromString.ur
new file mode 100644
index 00000000..d9a087e4
--- /dev/null
+++ b/tests/fromString.ur
@@ -0,0 +1,10 @@
+fun i2s s =
+ case stringToInt s of
+ None => 0
+ | Some n => n
+
+fun main () : transaction page = return <html><body>
+ Error = {cdata (show _ (i2s "Error"))}<br/>
+ 3 = {cdata (show _ (i2s "+3"))}<br/>
+</body></html>
+