Skip to content

Commit

Permalink
TRUNK-5480: adding test for plus sign version range
Browse files Browse the repository at this point in the history
  • Loading branch information
helderjosue committed Apr 5, 2024
1 parent e1b1eb2 commit bcdcf86
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/src/main/java/org/openmrs/module/ModuleUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,13 @@ public static boolean isOpenmrsVersionInVersions(String ...versions) {
* <li>1.2.*</li>
* <li>1.2.2 - 1.2.3</li>
* <li>1.2.* - 1.3.*</li>
* <li>1.4+ - 1.3.3</li>
* </ul>
* <p>
* Again the possible require version number formats with their interpretation:
* <ul>
* <li>1.2.3 means 1.2.3 and above</li>
* <li>1.4+ means 1.4.0 and above</li>
* <li>1.2.* means any version of the 1.2.x branch. That is 1.2.0, 1.2.1, 1.2.2,... but not 1.3.0, 1.4.0</li>
* <li>1.2.2 - 1.2.3 means 1.2.2 and 1.2.3 (inclusive)</li>
* <li>1.2.* - 1.3.* means any version of the 1.2.x and 1.3.x branch</li>
Expand Down
7 changes: 7 additions & 0 deletions api/src/test/java/org/openmrs/module/ModuleUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -773,4 +773,11 @@ protected File getEmptyJarDestinationFolder() throws IOException {
}
return destinationFolder;
}

@Test
public void matchRequiredVersions_shouldAllowRangedUsingPlusSignVersion() {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.4+ - 1.8.3";
assertTrue(ModuleUtil.matchRequiredVersions(openmrsVersion,requiredOpenmrsVersion));
}
}

0 comments on commit bcdcf86

Please sign in to comment.