summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-04-08 16:24:16 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2012-04-08 16:24:16 -0400
commitc0882be96431ac1572e17f9589dbc2f031bd9c0e (patch)
treed6449a3ee5fd57b04ef2daea40740f92834e7fc0 /tests
parentbdf92f16339818143596cf437f0d9e307ba54093 (diff)
Refactor to avoid dependence on recursive mutexes
Diffstat (limited to 'tests')
-rw-r--r--tests/goodbye.ur26
-rw-r--r--tests/goodbye.urp6
-rw-r--r--tests/goodbye.urs1
3 files changed, 33 insertions, 0 deletions
diff --git a/tests/goodbye.ur b/tests/goodbye.ur
new file mode 100644
index 00000000..1a466581
--- /dev/null
+++ b/tests/goodbye.ur
@@ -0,0 +1,26 @@
+table boo : { Client : client, Channel : channel unit }
+
+fun doIt () =
+ me <- self;
+ ch <- channel;
+ dml (INSERT INTO boo (Client, Channel) VALUES ({[me]}, {[ch]}));
+ return <xml><body onload={let
+ fun loop () =
+ v <- recv ch;
+ alert "Someone left";
+ loop ()
+ in
+ loop ()
+ end}/></xml>
+
+task clientLeaves = fn cl =>
+ debug "Client left";
+ dml (DELETE FROM boo WHERE Client = {[cl]});
+ queryI (SELECT (boo.Channel)
+ FROM boo)
+ (fn r => send r.1 ());
+ debug "Done processing"
+
+fun main () = return <xml><body>
+ <form> <submit action={doIt}/> </form>
+</body></xml>
diff --git a/tests/goodbye.urp b/tests/goodbye.urp
new file mode 100644
index 00000000..2a469815
--- /dev/null
+++ b/tests/goodbye.urp
@@ -0,0 +1,6 @@
+database dbname=goodbye
+sql goodbye.sql
+rewrite all Goodbye/*
+timeout 5
+
+goodbye \ No newline at end of file
diff --git a/tests/goodbye.urs b/tests/goodbye.urs
new file mode 100644
index 00000000..901d6bf2
--- /dev/null
+++ b/tests/goodbye.urs
@@ -0,0 +1 @@
+val main : {} -> transaction page