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

VersionChecker Logic is giving false negatives. #1022

Closed
dvantuyl opened this issue Apr 6, 2023 · 2 comments
Closed

VersionChecker Logic is giving false negatives. #1022

dvantuyl opened this issue Apr 6, 2023 · 2 comments

Comments

@dvantuyl
Copy link

dvantuyl commented Apr 6, 2023

Error:

You are using Curb 0.9.10. WebMock is known to work with Curb >= 0.7.16, < 1.1, except versions 0.8.7. It may not work with this version.

Broken Code (github link):

    def compare_version
      case
        when @major < @min_major then :too_low
        when @max_major && @major > @max_major then :too_high
        when @major > @min_major then :ok
        when @minor < @min_minor then :too_low
        when @max_minor && @minor > @max_minor then :too_high
        when @minor > @min_minor then :ok
        when @patch < @min_patch then :too_low
      end
    end

Values Mapped:

@major = 0
@minor = 9
@patch = 10

@min_major = 0
@min_minor = 7
@min_patch = 16

@max_major = 1
@max_minor = 0
@max_patch = 1

Issue:

  1. Passes through first :ok since (0 > 0) == false
  2. Errors on the second :too_high since (1 && 9 > 0)
@knarewski
Copy link

Likely a duplicate of #1006 ?

@dvantuyl
Copy link
Author

dvantuyl commented Apr 6, 2023

Yes thank you @knarewski. Closing as duplicate.

@dvantuyl dvantuyl closed this as completed Apr 6, 2023
@dvantuyl dvantuyl closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2023
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