void () { final String extras1 = "[PDF]"; final String name1 = "MyPackage"; final String extras2 = " [foo, bar]"; final String name2 = "Fizzy"; final String extras3 = " [security,tests]"; final String name3 = "requests"; doRequirementRelationTest(name1, extras1, LT, release("1.4")); doRequirementRelationTest(name2, extras2, LTE, release("1.4")); doRequirementRelationTest(name3, extras3, NE, release("1.4")); doRequirementRelationTest(name1, extras1, EQ, release("1.4")); doRequirementRelationTest(name2, extras2, GT, release("1.4")); doRequirementRelationTest(name3, extras3, GTE, release("1.4")); doRequirementRelationTest(name1, extras1, COMPATIBLE, release("1.*")); final String line1 = name2 + extras2 + STR_EQ.getPresentableText() + "version"; assertEquals( new PyRequirementImpl( name2, singletonList(pyRequirementVersionSpec(STR_EQ, "version")), singletonList(line1), StringUtil.trimLeading(extras2) ), fromLine(line1) ); doRequirementRelationTest(name3, extras3, Arrays.asList(GTE, EQ), Arrays.asList(release("2.8.1"), release("2.8.*"))); doRequirementRelationTest(name1, extras1, Arrays.asList(LT, GTE), Arrays.asList(release("1.4"), release("1.3.1"))); doRequirementRelationTest(name2, extras2, Arrays.asList(LT, GT, NE, LT, EQ), Arrays.asList(release("1.6"), release("1.9"), release("1.9.6"), new PyPackageVersion(null, "2.0", "a0", null, null, null), new PyPackageVersion(null, "2.4", "rc1", null, null, null))); // PY-14583 doRequirementRelationTest(name3, extras3, Arrays.asList(GTE, LTE, GTE, LTE), Arrays.asList(release("0.8.4"), release("0.8.99"), release("0.9.7"), release("0.9.99"))); }