void () { final PyRequirement requirement = fromLine("foo~=2.2"); final PyPackage release = new PyPackage("foo", "2.3"); final PyPackage pre = new PyPackage("foo", "2.3a1"); final PyPackage post = new PyPackage("foo", "2.3.post1"); final PyPackage dev = new PyPackage("foo", "2.3.dev1"); final PyPackage localVersion = new PyPackage("foo", "2.3+local.version"); assertEquals(release, requirement.match(singletonList(release))); assertEquals(pre, requirement.match(singletonList(pre))); assertEquals(post, requirement.match(singletonList(post))); assertEquals(dev, requirement.match(singletonList(dev))); assertEquals(localVersion, requirement.match(singletonList(localVersion))); final PyRequirement moreModernRequirement = fromLine("foo~=2.4"); assertNull(moreModernRequirement.match(Arrays.asList(release, pre, post, dev, localVersion))); }