summaryrefslogtreecommitdiff
path: root/tests/rpchan.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2014-08-24 11:43:49 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2014-08-24 11:43:49 -0400
commit12dfc3678d66bc5d04ef59f00e3af5a37add1ac0 (patch)
treecfd3d52195dfbd2eaf4530ca33e72d7adaa4b77d /tests/rpchan.ur
parentd04c48b573d36ee7a04ea1b44ec95f79f6a07b6a (diff)
Extend ScriptCheck to take RPCs into account
Diffstat (limited to 'tests/rpchan.ur')
-rw-r--r--tests/rpchan.ur18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/rpchan.ur b/tests/rpchan.ur
new file mode 100644
index 00000000..08308d90
--- /dev/null
+++ b/tests/rpchan.ur
@@ -0,0 +1,18 @@
+fun remote () =
+ ch <- channel;
+ send ch "Hello World!";
+ return ch
+
+fun remoter () =
+ ch <- channel;
+ send ch "Hello World!";
+ return <xml><active code={spawn (s <- recv ch; alert s); return <xml/>}/></xml>
+
+fun main () =
+ x <- source <xml/>;
+ return <xml><body>
+ <button onclick={fn _ => ch <- rpc (remote ()); s <- recv ch; alert s}>TEST</button>
+ <button onclick={fn _ => y <- rpc (remoter ()); set x y}>TESTER</button>
+ <hr/>
+ <dyn signal={signal x}/>
+ </body></xml>