diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-09-07 11:33:13 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-09-07 11:33:13 -0400 |
commit | 5cf1d4d086475575a31f57413c57c22bd6fda378 (patch) | |
tree | ab36ce67d2931f2c715b5b734930139c53adc670 /tests | |
parent | 42c284b9204ef5dfc249cc7273ff2eaa9304e9e6 (diff) |
Converting string to int
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fromString.ur | 10 | ||||
-rw-r--r-- | tests/fromString.urp | 5 |
2 files changed, 15 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> + diff --git a/tests/fromString.urp b/tests/fromString.urp new file mode 100644 index 00000000..0e6b6640 --- /dev/null +++ b/tests/fromString.urp @@ -0,0 +1,5 @@ +debug +database dbname=test +exe /tmp/webapp + +fromString |