summaryrefslogtreecommitdiff
path: root/tests/activeBlock.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-07-25 08:20:15 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2012-07-25 08:20:15 -0400
commit59fbe515a0462e98ab3cbb78a1f136f382ab927a (patch)
tree5bad8880a0a764f7d77e14b382ddb07ec268fb18 /tests/activeBlock.ur
parent6f9747dbea34c09ae40f9859f63ad77abc1bd950 (diff)
Change 'spawn' implementation to allow blocking within <active code>
Diffstat (limited to 'tests/activeBlock.ur')
-rw-r--r--tests/activeBlock.ur10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/activeBlock.ur b/tests/activeBlock.ur
new file mode 100644
index 00000000..5560edda
--- /dev/null
+++ b/tests/activeBlock.ur
@@ -0,0 +1,10 @@
+fun main () : transaction page = return <xml><body>
+ <active code={s <- source ""; return <xml>
+ <dyn signal={s <- signal s; return (txt s)}/>
+ <button onclick={fn _ => set s "Hi!"}/>
+ </xml>}/>
+
+ <active code={sleep 1; return <xml>Hi!</xml>}/>
+
+ <active code={spawn (sleep 1; alert "Hi!"); return <xml>Success</xml>}/>
+</body></xml>