summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/jsinj.ur18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/jsinj.ur b/tests/jsinj.ur
index 194d26be..d5bd7dbb 100644
--- a/tests/jsinj.ur
+++ b/tests/jsinj.ur
@@ -1,14 +1,24 @@
-cookie int : int
-
fun getOpt (t ::: Type) (o : option t) (v : t) : t =
case o of
None => v
| Some x => x
+cookie int : int
+cookie float : float
+
fun main () : transaction page =
n <- getCookie int;
- sn <- source (getOpt n 7);
+ n <- return (getOpt n 7);
+ sn <- source 6;
+
+ f <- getCookie float;
+ f <- return (getOpt f 1.23);
+ sf <- source 4.56;
+
return <xml><body>
<dyn signal={n <- signal sn; return <xml>{[n]}</xml>}/>
- <a onclick={set sn 6}>CHANGE</a>
+ <a onclick={set sn n}>CHANGE</a><br/>
+
+ <dyn signal={f <- signal sf; return <xml>{[f]}</xml>}/>
+ <a onclick={set sf f}>CHANGE</a><br/>
</body></xml>