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

IPAddr.new("0.0.0.0") == nil return true #75

Open
taketo1113 opened this issue Aug 27, 2024 · 0 comments · May be fixed by #76
Open

IPAddr.new("0.0.0.0") == nil return true #75

taketo1113 opened this issue Aug 27, 2024 · 0 comments · May be fixed by #76

Comments

@taketo1113
Copy link
Contributor

taketo1113 commented Aug 27, 2024

IPAddr.new("0.0.0.0") == nil and nil == IPAddr.new("0.0.0.0") return different result.

Steps to reproduce

# IPv4
IPAddr.new("0.0.0.0") == nil
=> true # expected false

nil == IPAddr.new('0.0.0.0') 
=> false

IPAddr.new("0.0.0.0").nil?
=> false

# IPv6
IPAddr.new("::") == nil
=> true # expected false

nil == IPAddr.new("::")
=> false

IPAddr.new("::").nil?
=> false

Expected behavior

IPAddr.new("0.0.0.0") == nil return false, just like IPAddr.new("0.0.0.0").nil?.

Actual behavior

IPAddr.new("0.0.0.0") == nil return true.

System configuration

  • IPAddr version: 1.2.5
  • Ruby version: 3.3.4

Related Issue

@taketo1113 taketo1113 linked a pull request Aug 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant