diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-01-01 16:11:42 -0500 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-01-01 16:11:42 -0500 |
commit | 36e59f6512af87c02ba856372d71a6a47e9045fd (patch) | |
tree | 80d53bab75fbe437b17753868f154b870721d15b /tests/jsinj.ur | |
parent | 17ffca0b16e45aa093a9c1d55b0e629a4cf26798 (diff) |
Injecting strings and bools
Diffstat (limited to 'tests/jsinj.ur')
-rw-r--r-- | tests/jsinj.ur | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/jsinj.ur b/tests/jsinj.ur index d5bd7dbb..bd416720 100644 --- a/tests/jsinj.ur +++ b/tests/jsinj.ur @@ -5,6 +5,8 @@ fun getOpt (t ::: Type) (o : option t) (v : t) : t = cookie int : int cookie float : float +cookie string : string +cookie bool : bool fun main () : transaction page = n <- getCookie int; @@ -15,10 +17,24 @@ fun main () : transaction page = f <- return (getOpt f 1.23); sf <- source 4.56; + s <- getCookie string; + s <- return (getOpt s "Hi"); + ss <- source "Bye"; + + b <- getCookie bool; + b <- return (getOpt b True); + sb <- source False; + return <xml><body> <dyn signal={n <- signal sn; return <xml>{[n]}</xml>}/> <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/> + + <dyn signal={s <- signal ss; return <xml>{[s]}</xml>}/> + <a onclick={set ss s}>CHANGE</a><br/> + + <dyn signal={b <- signal sb; return <xml>{[b]}</xml>}/> + <a onclick={set sb b}>CHANGE</a><br/> </body></xml> |