add first unit tests

the ci has always had a 'mvn test' step, but there was nothing to
test. add junit 6 and pin surefire 3.6.0, extract the os detection
into a testable fromOsName method, and cover the movement step math
- including the axis-aligned cases that used to produce infinite
steps and never converge.
This commit is contained in:
bea
2026-09-29 11:51:13 +02:00
parent e551d24bff
commit ed90b246d6
4 changed files with 174 additions and 6 deletions
@@ -6,14 +6,18 @@ public class SystemUtil
{
public static OperatingSystem getHostSystem() {
String osName = System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
if (osName.contains("win")) {
return fromOsName(System.getProperty("os.name"));
}
public static OperatingSystem fromOsName(String osName) {
String normalizedOsName = osName.toLowerCase(Locale.ENGLISH);
if (normalizedOsName.contains("win")) {
return OperatingSystem.WINDOWS;
} else if (osName.contains("nix") ||
osName.contains("nux") ||
osName.contains("aix")) {
} else if (normalizedOsName.contains("nix") ||
normalizedOsName.contains("nux") ||
normalizedOsName.contains("aix")) {
return OperatingSystem.LINUX;
} else if (osName.contains("mac")) {
} else if (normalizedOsName.contains("mac")) {
return OperatingSystem.MAC_OS;
} else {
return OperatingSystem.UNKNOWN;