Skip to content

Commit

Permalink
fix: add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylong committed Dec 29, 2022
1 parent 6814ae1 commit 1e9edc8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/src/test/java/org/owasp/dependencycheck/utils/SemverTest.java
Expand Up @@ -13,6 +13,7 @@
*/
package org.owasp.dependencycheck.utils;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;
Expand All @@ -32,4 +33,15 @@ public void testSemver() {
Semver semver = new Semver("3.1.4");
assertTrue(semver.satisfies("^3.0.0-0"));
}
/**
* Test of semver4j. See https://github.com/jeremylong/DependencyCheck/issues/5158
*/
@Test
public void testSemverComplex() {
Semver semver = new Semver("18.11.5");
assertFalse(semver.satisfies("^14.14.20 || ^16.0.0"));

semver = new Semver("14.15.0");
assertTrue(semver.satisfies("^14.14.20 || ^16.0.0"));
}
}

0 comments on commit 1e9edc8

Please sign in to comment.