mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[commands] Test no-op behavior of scheduling a scheduled command (#4806)
This commit is contained in:
@@ -70,4 +70,18 @@ class SchedulerTest extends CommandTestBase {
|
||||
assertEquals(counter.get(), 2);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void scheduleScheduledNoOp() {
|
||||
try (CommandScheduler scheduler = new CommandScheduler()) {
|
||||
AtomicInteger counter = new AtomicInteger();
|
||||
|
||||
Command command = Commands.startEnd(counter::incrementAndGet, () -> {});
|
||||
|
||||
scheduler.schedule(command);
|
||||
scheduler.schedule(command);
|
||||
|
||||
assertEquals(counter.get(), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user