Skip to content

Commit

Permalink
Rename thenAwaitTimeout to thenWait and improve docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
katzuv committed Oct 13, 2024
1 parent 5cd92de commit 030fb8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ public SequentialCommandGroup thenAwait(BooleanSupplier condition) {
}

/**
* Decorates this command with a timeout to pass for after this command is finished. The command will finish after
* this timeout has passed.
* Decorates this command with a time to pass after this command is finished. The command will finish after
* this time has passed.
*
* <p>Note: This decorator works by adding this command to a composition. The command the
* decorator was called on cannot be scheduled independently or be added to a different
Expand All @@ -228,9 +228,9 @@ public SequentialCommandGroup thenAwait(BooleanSupplier condition) {
* returned from this method can be further decorated without issue.
*
* @param seconds the timeout duration
* @return the command with the timeout to await
* @return the command with the time to wait
*/
public SequentialCommandGroup thenAwaitTimeout(double seconds) {
public SequentialCommandGroup thenWait(double seconds) {
return andThen(Commands.waitSeconds(seconds));
}

Expand All @@ -247,8 +247,8 @@ public SequentialCommandGroup thenAwaitTimeout(double seconds) {
* @param time the timeout duration
* @return the command with the timeout to await
*/
public SequentialCommandGroup thenAwaitTimeout(Time time) {
return thenAwaitTimeout(time.in(Seconds));
public SequentialCommandGroup thenWait(Time time) {
return thenWait(time.in(Seconds));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ void thenAwaitTest() {

@Test
@ResourceLock("timing")
void awaitTimeoutTest() {
void thenWaitTest() {
HAL.initialize(500, 0);
SimHooks.pauseTiming();
try (CommandScheduler scheduler = new CommandScheduler()) {
Command awaitTimeout = new RunCommand(() -> {}).thenAwaitTimeout(0.1);
Command awaitTimeout = new RunCommand(() -> {}).thenWait(0.1);

scheduler.schedule(awaitTimeout);
scheduler.run();
Expand Down

0 comments on commit 030fb8e

Please sign in to comment.