Skip to content

Commit

Permalink
Add new tests for version parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkak committed Oct 4, 2023
1 parent 881ccfc commit fe25fa5
Showing 1 changed file with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,39 @@ static void assertVersion(Version graalVmVersion, Distribution distro, Version v
}
}

@Test
public void testGraalVM21VersionParser() {
Version graalVM21Dev = Version.of(Stream.of(("native-image 21 2023-09-19\n"
+ "GraalVM Runtime Environment GraalVM CE 21+35.1 (build 21+35-jvmci-23.1-b15)\n"
+ "Substrate VM GraalVM CE 21+35.1 (build 21+35, serial gc)").split("\\n")));
assertThat(graalVM21Dev.distribution.name()).isEqualTo("GRAALVM");
assertThat(graalVM21Dev.getVersionAsString()).isEqualTo("23.1");
assertThat(graalVM21Dev.javaFeatureVersion).isEqualTo(21);
assertThat(graalVM21Dev.javaUpdateVersion).isEqualTo(0);
}

@Test
public void testGraalVM21DevVersionParser() {
Version graalVM21Dev = Version.of(Stream.of(("native-image 21 2023-09-19\n" +
"GraalVM Runtime Environment GraalVM CE 21-dev+35.1 (build 21+35-jvmci-23.1-b14)\n" +
"Substrate VM GraalVM CE 21-dev+35.1 (build 21+35, serial gc)").split("\\n")));
assertThat(graalVM21Dev.distribution.name()).isEqualTo("GRAALVM");
assertThat(graalVM21Dev.getVersionAsString()).isEqualTo("23.1-dev");
assertThat(graalVM21Dev.javaFeatureVersion).isEqualTo(21);
assertThat(graalVM21Dev.javaUpdateVersion).isEqualTo(0);
}

@Test
public void testGraalVM22DevVersionParser() {
Version graalVM22Dev = Version.of(Stream.of(("native-image 22 2024-03-19\n"
+ "GraalVM Runtime Environment GraalVM CE 22-dev+16.1 (build 22+16-jvmci-b01)\n"
+ "Substrate VM GraalVM CE 22-dev+16.1 (build 22+16, serial gc)").split("\\n")));
assertThat(graalVM22Dev.distribution.name()).isEqualTo("GRAALVM");
assertThat(graalVM22Dev.getVersionAsString()).isEqualTo("24.0-dev");
assertThat(graalVM22Dev.javaFeatureVersion).isEqualTo(22);
assertThat(graalVM22Dev.javaUpdateVersion).isEqualTo(0);
}

@Test
public void testGraalVMVersionsOlderThan() {
assertOlderThan("GraalVM Version 19.3.6 CE", "GraalVM Version 20.2.0 (Java Version 11.0.9)");
Expand Down

0 comments on commit fe25fa5

Please sign in to comment.