diff options
author | Adam Chlipala <adamc@csail.mit.edu> | 2016-06-17 16:39:59 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@csail.mit.edu> | 2016-06-17 16:39:59 -0400 |
commit | f38ff008676993c9b690cccaad9ca25d56b90530 (patch) | |
tree | 71436e9f4e59c8618eaded77fb0625df94646cfc /tests | |
parent | 5ac04f029f2876284e8af10275bdd63e75fc90e7 (diff) | |
parent | f050c7f1de1fe03e2253f408445a69e9402f60ee (diff) |
Merge branch 'master' of ssh://github.com/urweb/urweb
Diffstat (limited to 'tests')
-rw-r--r-- | tests/timeout.ur | 22 | ||||
-rw-r--r-- | tests/timeout.urp | 7 | ||||
-rw-r--r-- | tests/timeout.urs | 1 |
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/timeout.ur b/tests/timeout.ur new file mode 100644 index 00000000..d96b42bd --- /dev/null +++ b/tests/timeout.ur @@ -0,0 +1,22 @@ +table listeners : { Ch : channel unit } + +fun ping () = + queryI1 (SELECT * FROM listeners) + (fn r => send r.Ch ()) + +fun main () = + ch <- channel; + dml (INSERT INTO listeners(Ch) VALUES ({[ch]})); + count <- source 0; + return <xml><body onload={let + fun loop () = + _ <- recv ch; + c <- get count; + set count (c + 1); + loop () + in + loop () + end}> + <dyn signal={n <- signal count; return (txt n)}/> + <button onclick={fn _ => rpc (ping ())}>Ping</button> + </body></xml> diff --git a/tests/timeout.urp b/tests/timeout.urp new file mode 100644 index 00000000..6d3ca878 --- /dev/null +++ b/tests/timeout.urp @@ -0,0 +1,7 @@ +timeout 2 +rewrite url Timeout/* +database dbname=test +sql timeout.sql +safeGet main + +timeout diff --git a/tests/timeout.urs b/tests/timeout.urs new file mode 100644 index 00000000..6ac44e0b --- /dev/null +++ b/tests/timeout.urs @@ -0,0 +1 @@ +val main : unit -> transaction page |