mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-11-13 05:54:01 +01:00
Changing assumptions
- The SyncedPlan no longer runs immediately if executed on the main thread. - Update tests/names to reflect this change.
This commit is contained in:
parent
59cb5f7dbf
commit
331c33b975
@ -189,17 +189,21 @@ class PlanExecutionTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void mainThreadPlanRunsImmediately() {
|
void syncedPlanDefersOnMainThread() {
|
||||||
var done = new AtomicBoolean(false);
|
var done = new AtomicBoolean(false);
|
||||||
var plan = SyncedPlan.of(() -> done.set(true));
|
var plan = SyncedPlan.of(() -> done.set(true));
|
||||||
|
|
||||||
plan.execute(EXECUTOR, Unit.INSTANCE);
|
plan.execute(EXECUTOR, Unit.INSTANCE);
|
||||||
|
|
||||||
|
Assertions.assertFalse(done.get());
|
||||||
|
|
||||||
|
EXECUTOR.syncPoint();
|
||||||
|
|
||||||
Assertions.assertTrue(done.get());
|
Assertions.assertTrue(done.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void mainThreadPlanIsNotCalledOffThread() {
|
void syncedPlanDefersOffThread() {
|
||||||
var done = new AtomicBoolean(false);
|
var done = new AtomicBoolean(false);
|
||||||
|
|
||||||
var plan = SyncedPlan.of(() -> {
|
var plan = SyncedPlan.of(() -> {
|
||||||
|
Loading…
Reference in New Issue
Block a user