[hal, wpilib] Add RobotController.getComments() (#4463)

This commit is contained in:
Ryan Blue
2022-12-26 14:39:51 -05:00
committed by GitHub
parent 26bdbf3d41
commit 2ac41f3edc
19 changed files with 310 additions and 1 deletions

View File

@@ -226,4 +226,23 @@ class RoboRioSimTest {
assertEquals(kSerialNumberTruncated, RoboRioSim.getSerialNumber());
assertEquals(kSerialNumberTruncated, RobotController.getSerialNumber());
}
@Test
void testComments() {
RoboRioSim.resetData();
final String kComments = "Hello! These are comments in the roboRIO web interface!";
RoboRioSim.setComments(kComments);
assertEquals(kComments, RoboRioSim.getComments());
assertEquals(kComments, RobotController.getComments());
final String kCommentsOverflow =
"Hello! These are comments in the roboRIO web interface!"
+ " This comment exceeds 64 characters!";
final String kCommentsTruncated = kCommentsOverflow.substring(0, 64);
RoboRioSim.setComments(kCommentsOverflow);
assertEquals(kCommentsTruncated, RoboRioSim.getComments());
assertEquals(kCommentsTruncated, RobotController.getComments());
}
}