diff tests/jsinj.ur @ 593:f277f5faebcd

Injected a record
author Adam Chlipala <adamc@hcoop.net>
date Fri, 02 Jan 2009 12:42:39 -0500
parents a8be5a2068a5
children 55829473f6a7
line wrap: on
line diff
--- a/tests/jsinj.ur	Thu Jan 01 16:11:42 2009 -0500
+++ b/tests/jsinj.ur	Fri Jan 02 12:42:39 2009 -0500
@@ -7,6 +7,7 @@
 cookie float : float
 cookie string : string
 cookie bool : bool
+cookie pair : int * float
 
 fun main () : transaction page =
     n <- getCookie int;
@@ -25,6 +26,10 @@
     b <- return (getOpt b True);
     sb <- source False;
 
+    p <- getCookie pair;
+    p <- return (getOpt p (1, 2.3));
+    sp <- source (4, 5.6);
+
     return <xml><body>
       <dyn signal={n <- signal sn; return <xml>{[n]}</xml>}/>
       <a onclick={set sn n}>CHANGE</a><br/>
@@ -37,4 +42,7 @@
 
       <dyn signal={b <- signal sb; return <xml>{[b]}</xml>}/>
       <a onclick={set sb b}>CHANGE</a><br/>
+
+      <dyn signal={p <- signal sp; return <xml>{[p.1]}, {[p.2]}</xml>}/>
+      <a onclick={set sp p}>CHANGE</a><br/>
     </body></xml>