-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "2.x" not appending an empty build version to the resulting predi…
…cate. (#425) This used to turn "2.x" or "=2.x" into "^2-", however a while ago this accidently got changed to "^2". Honestly, I'm unsure which way is correct. However this was changed accidently during our Version.Sementic switching to non-null build & pre-release, so it's been changed back.
- Loading branch information
Showing
4 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/test/java/net/fabricmc/test/VersionPredicateTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package net.fabricmc.test; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import net.fabricmc.loader.api.Version; | ||
import net.fabricmc.loader.api.VersionParsingException; | ||
import net.fabricmc.loader.api.metadata.version.VersionPredicate; | ||
|
||
public class VersionPredicateTests { | ||
@Test | ||
public void testPredicates() throws VersionParsingException { | ||
VersionPredicate predicate = VersionPredicate.parse("2.x.x"); | ||
Version version = Version.parse("2.0.0-beta3"); | ||
Assertions.assertTrue(predicate.test(version), predicate + " does not allow " + version); | ||
} | ||
} |