2016-08-08 01:05:35 +00:00
|
|
|
// Illustrates a bug where dataflow damage was being repaired even for
|
|
|
|
// subjects pertaining to previously-terminated facets.
|
|
|
|
//
|
|
|
|
// Should eventually be turned into some kind of test case.
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
// Bad output:
|
|
|
|
//
|
|
|
|
// OUTER++ first
|
|
|
|
// ++ first
|
|
|
|
// VIEW++ VIEW first
|
|
|
|
// VIEW-- VIEW first
|
|
|
|
// VIEW++ EDIT first
|
|
|
|
// VIEW-- EDIT first
|
|
|
|
// VIEW++ VIEW first
|
|
|
|
// -- first
|
|
|
|
// OUTER-- first
|
|
|
|
// OUTER++ second
|
|
|
|
// ++ second
|
|
|
|
// VIEW-- VIEW first
|
|
|
|
// VIEW++ VIEW second
|
|
|
|
// Kicking off second edit cycle
|
|
|
|
// VIEW-- VIEW second
|
|
|
|
// VIEW++ EDIT second
|
|
|
|
// VIEW++ EDIT first
|
|
|
|
// VIEW-- EDIT second
|
|
|
|
// VIEW-- EDIT first
|
|
|
|
// VIEW++ VIEW second
|
|
|
|
// VIEW++ VIEW first
|
|
|
|
//
|
|
|
|
// Notice the appearance of "first" even after the "second edit cycle" has been kicked off!
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
// Good output:
|
|
|
|
//
|
|
|
|
// OUTER++ first
|
|
|
|
// ++ first
|
|
|
|
// VIEW++ VIEW first
|
|
|
|
// VIEW-- VIEW first
|
|
|
|
// VIEW++ EDIT first
|
|
|
|
// VIEW-- EDIT first
|
|
|
|
// VIEW++ VIEW first
|
|
|
|
// -- first
|
|
|
|
// OUTER-- first
|
|
|
|
// OUTER++ second
|
|
|
|
// ++ second
|
|
|
|
// VIEW-- VIEW first
|
|
|
|
// VIEW++ VIEW second
|
|
|
|
// Kicking off second edit cycle
|
|
|
|
// VIEW-- VIEW second
|
|
|
|
// VIEW++ EDIT second
|
|
|
|
// VIEW-- EDIT second
|
|
|
|
// VIEW++ VIEW second
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
var Syndicate = require('./src/main.js');
|
|
|
|
|
|
|
|
assertion type todo(title);
|
|
|
|
assertion type show();
|
|
|
|
assertion type view(str);
|
|
|
|
|
|
|
|
ground dataspace {
|
2017-02-16 19:38:56 +00:00
|
|
|
spawn {
|
2016-08-25 12:12:32 +00:00
|
|
|
field this.title = "first";
|
|
|
|
assert todo(this.title);
|
|
|
|
on message 3 {
|
|
|
|
this.title = "second";
|
2016-08-08 01:05:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-16 19:38:56 +00:00
|
|
|
spawn {
|
2016-08-25 12:12:32 +00:00
|
|
|
assert show();
|
2016-08-08 01:05:35 +00:00
|
|
|
}
|
|
|
|
|
2017-02-16 19:38:56 +00:00
|
|
|
spawn {
|
2016-08-25 12:12:32 +00:00
|
|
|
field this.editing = false;
|
2016-08-08 01:05:35 +00:00
|
|
|
|
2016-08-25 12:12:32 +00:00
|
|
|
during todo($title) {
|
|
|
|
on start { console.log('OUTER++', title); }
|
|
|
|
during show() {
|
|
|
|
on start { console.log('++', title); }
|
|
|
|
assert view((this.editing ? 'EDIT ' : 'VIEW ') + title);
|
|
|
|
on stop { console.log('--', title); }
|
2016-08-08 01:05:35 +00:00
|
|
|
}
|
2016-08-25 12:12:32 +00:00
|
|
|
on stop { console.log('OUTER--', title); }
|
|
|
|
}
|
2016-08-08 01:05:35 +00:00
|
|
|
|
2016-08-25 12:12:32 +00:00
|
|
|
on message 1 {
|
|
|
|
this.editing = true;
|
|
|
|
:: 2;
|
|
|
|
}
|
2016-08-08 01:05:35 +00:00
|
|
|
|
2016-08-25 12:12:32 +00:00
|
|
|
on message 2 {
|
|
|
|
:: 3;
|
|
|
|
this.editing = false;
|
2016-08-08 01:05:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-16 19:38:56 +00:00
|
|
|
spawn {
|
2016-08-25 12:12:32 +00:00
|
|
|
on start { :: 0; }
|
|
|
|
stop on message 0 {
|
|
|
|
:: 1;
|
2016-08-08 01:05:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-16 19:38:56 +00:00
|
|
|
spawn {
|
2016-08-25 12:12:32 +00:00
|
|
|
field this.count = 0;
|
|
|
|
on retracted view($x) { console.log('VIEW--', x); }
|
|
|
|
on asserted view($x) {
|
|
|
|
console.log('VIEW++', x);
|
|
|
|
if (x === 'VIEW second') {
|
|
|
|
this.count++;
|
|
|
|
if (this.count === 1) {
|
|
|
|
console.log("Kicking off second edit cycle");
|
|
|
|
:: 1;
|
2016-08-08 01:05:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|