aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-01-01 15:11:17 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-01-01 15:11:17 -0500
commit8bb915433716ecfdcf2c2209d1a62796ebde4714 (patch)
treeafcd03a0701dad1cab0952d31ab827a54bc474ae /tests
parentef3b3f91435a9a924771c373dc53547e2ebd4503 (diff)
Injecting an int
Diffstat (limited to 'tests')
-rw-r--r--tests/jsinj.ur14
-rw-r--r--tests/jsinj.urp3
2 files changed, 17 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>
diff --git a/tests/jsinj.urp b/tests/jsinj.urp
new file mode 100644
index 00000000..dc929b9d
--- /dev/null
+++ b/tests/jsinj.urp
@@ -0,0 +1,3 @@
+debug
+
+jsinj