mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Improve command decorator names (#1945)
This commit is contained in:
@@ -36,12 +36,12 @@ class CommandDecoratorTest extends CommandTestBase {
|
||||
}
|
||||
|
||||
@Test
|
||||
void interruptOnTest() {
|
||||
void withInterruptTest() {
|
||||
CommandScheduler scheduler = new CommandScheduler();
|
||||
|
||||
ConditionHolder condition = new ConditionHolder();
|
||||
|
||||
Command command = new WaitCommand(10).interruptOn(condition::getCondition);
|
||||
Command command = new WaitCommand(10).withInterrupt(condition::getCondition);
|
||||
|
||||
scheduler.schedule(command);
|
||||
scheduler.run();
|
||||
@@ -66,7 +66,7 @@ class CommandDecoratorTest extends CommandTestBase {
|
||||
}
|
||||
|
||||
@Test
|
||||
void whenFinishedTest() {
|
||||
void andThenLambdaTest() {
|
||||
CommandScheduler scheduler = new CommandScheduler();
|
||||
|
||||
ConditionHolder condition = new ConditionHolder();
|
||||
@@ -74,7 +74,7 @@ class CommandDecoratorTest extends CommandTestBase {
|
||||
|
||||
Command command = new InstantCommand();
|
||||
|
||||
scheduler.schedule(command.whenFinished(() -> condition.setCondition(true)));
|
||||
scheduler.schedule(command.andThen(() -> condition.setCondition(true)));
|
||||
|
||||
assertFalse(condition.getCondition());
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class CommandGroupErrorTest extends CommandTestBase {
|
||||
void redecoratedCommandErrorTest() {
|
||||
Command command = new InstantCommand();
|
||||
|
||||
assertDoesNotThrow(() -> command.withTimeout(10).interruptOn(() -> false));
|
||||
assertDoesNotThrow(() -> command.withTimeout(10).withInterrupt(() -> false));
|
||||
assertThrows(IllegalArgumentException.class, () -> command.withTimeout(10));
|
||||
CommandGroupBase.clearGroupedCommand(command);
|
||||
assertDoesNotThrow(() -> command.withTimeout(10));
|
||||
|
||||
Reference in New Issue
Block a user