Skip to content

Fix inconsistent behavior between IPAddr.new("0.0.0.0") == nil and nil == IPAddr.new("0.0.0.0")#18

Merged
taketo1113 merged 1 commit into
masterfrom
equal-nil
Apr 24, 2026
Merged

Fix inconsistent behavior between IPAddr.new("0.0.0.0") == nil and nil == IPAddr.new("0.0.0.0")#18
taketo1113 merged 1 commit into
masterfrom
equal-nil

Conversation

@taketo1113
Copy link
Copy Markdown
Member

Summary

This Pull Request fixes inconsistent behavior between IPAddr.new("0.0.0.0") == nil and nil == IPAddr.new("0.0.0.0").

This is to verify whether the following Pull Request for the ipaddr gem works in a real Ruby application.

Changes

# 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

Related URL

@taketo1113 taketo1113 self-assigned this Apr 24, 2026
@taketo1113 taketo1113 merged commit 72e7377 into master Apr 24, 2026
41 checks passed
@taketo1113 taketo1113 deleted the equal-nil branch April 24, 2026 05:25
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

Successfully merging this pull request may close these issues.

1 participant