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