[wpilibc] Alert: Fix first alert in group not publishing data (#7711)

This commit is contained in:
Ryan Blue
2025-01-20 11:10:03 -05:00
committed by GitHub
parent 72541c10e6
commit 304b98c0c9
3 changed files with 25 additions and 6 deletions

View File

@@ -81,7 +81,18 @@ class AlertTest {
}
@Test
void setUnset() {
void setUnsetSingle() {
try (var one = makeAlert("one", AlertType.kInfo)) {
assertFalse(isAlertActive("one", AlertType.kInfo));
one.set(true);
assertTrue(isAlertActive("one", AlertType.kInfo));
one.set(false);
assertFalse(isAlertActive("one", AlertType.kInfo));
}
}
@Test
void setUnsetMultiple() {
try (var one = makeAlert("one", AlertType.kError);
var two = makeAlert("two", AlertType.kInfo)) {
assertFalse(isAlertActive("one", AlertType.kError));