mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[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:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user