[commands] Fix JoystickButton.getAsBoolean (#4131)

This previously always returned false; the get method it inherited was not used in the getAsBoolean defined in the Trigger class. The fix is to swap get() and getAsBoolean() implementations in the Trigger class.
This commit is contained in:
ohowe
2022-04-08 22:20:23 -06:00
committed by GitHub
parent 1b26e2d5da
commit f27a1f9bfb
2 changed files with 12 additions and 3 deletions

View File

@@ -195,4 +195,13 @@ class ButtonTest extends CommandTestBase {
scheduler.run();
verify(command).schedule(true);
}
@Test
void booleanSupplierTest() {
InternalButton button = new InternalButton();
assertFalse(button.getAsBoolean());
button.setPressed(true);
assertTrue(button.getAsBoolean());
}
}