Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible regression caught by semver's test suite #39

Closed
steveklabnik opened this issue Dec 8, 2017 · 4 comments
Closed

Possible regression caught by semver's test suite #39

steveklabnik opened this issue Dec 8, 2017 · 4 comments

Comments

@steveklabnik
Copy link
Owner

steveklabnik commented Dec 8, 2017

I ported semver to HEAD of semver-parser, and I get these test failures:

---- version::tests::test_from_str_errors stdout ----
        thread 'version::tests::test_from_str_errors' panicked at 'assertion failed: `(left == right)`
  left: `Err(ParseError("expected more input"))`,
 right: `Err(ParseError("Error parsing major identifier"))`', src\version.rs:850:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.

---- version::tests::test_parse stdout ----
        thread 'version::tests::test_parse' panicked at 'assertion failed: `(left == right)`
  left: `Err(ParseError("expected more input"))`,
 right: `Err(ParseError("Error parsing major identifier"))`', src\version.rs:395:8

---- version_req::test::test_ordering stdout ----
        thread 'version_req::test::test_ordering' panicked at 'assertion failed: req("=1") < req("*")', src\version_req.rs:953:8

cc @udoprog

The first two are because I'm testing the literal string output; I don't think that's actually part of the contract, and besides semver is also pre-1.0 so they don't matter. Additionally, they're actually two tests of the same thing. So really one failure.

The last one is curious though. I haven't actually debugged this one, so it might be a bug in my small port, or it might be here. needs investigation.

@steveklabnik
Copy link
Owner Author

If it's here, #29 would be the cause, I'd imagine.

@steveklabnik
Copy link
Owner Author

ah ha! so, I think I've narrowed this down; we rely on the derived implementations of PartialOrd, and so I bet #29's change changed how those comparisons work. gah.

I think that means that the bug is in semver, not here!

@udoprog
Copy link
Contributor

udoprog commented Dec 8, 2017

This is fixed in dtolnay/semver#151. Ordering relative to the wildcard changes because it's modeled as an empty set of predicates instead of a predicate WildcardVersion::Major variant.

@steveklabnik
Copy link
Owner Author

ah ha! You're the best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants