From 6796c871f25ea419fc92801fdce1f25c3d443edb Mon Sep 17 00:00:00 2001 From: sbosse Date: Tue, 27 Aug 2024 00:14:57 +0200 Subject: [PATCH] Tue 27 Aug 00:14:56 CEST 2024 --- test/test-amp-t1b.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 test/test-amp-t1b.js diff --git a/test/test-amp-t1b.js b/test/test-amp-t1b.js new file mode 100644 index 0000000..b99119d --- /dev/null +++ b/test/test-amp-t1b.js @@ -0,0 +1,44 @@ +config({ + log:{ + time:true + } +}) + +port(DIR.IP('tcp://localhost')) +connect(DIR.IP('tcp://localhost:4569')); + +function ag() { + this.goto=null; + this.root=null; + this.act = { + check: function () { + log('Waiting'); + this.root=myNode(); + var links=link(DIR.IP('%')); + if (links && links.length) + this.goto=links[0]; + else sleep(500); + }, + move: function () { + log('Going to '+this.goto); + moveto(DIR.NODE(this.goto)) + }, + back: function () { + log('Going back to '+this.root); + moveto(DIR.NODE(this.root)) + }, + end: function () { + log('Terminating'); + kill(); + }, + } + this.trans = { check:function () { return this.goto?'move':'check' }, + move:'back', + back:'end' } + this.next = 'check'; +} + +start() +var t = setTimeout(function () { + print(create(ag,{},2)); +},1000);