1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

resolv.rb: dots differences

* lib/resolv.rb (Resolv::DNS::Name): names with different dots
  should be different.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-12-30 07:03:47 +00:00
parent 5cc1e95be3
commit a0325ea704
3 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Tue Dec 30 16:03:45 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/resolv.rb (Resolv::DNS::Name): names with different dots
should be different.
Tue Dec 30 13:16:56 2014 Martin Duerst <bernhard+git@lsmod.de>
* lib/uri/common.rb: Initialize HTML5ASCIIINCOMPAT to empty Array

View file

@ -1236,7 +1236,8 @@ class Resolv
def ==(other) # :nodoc:
return false unless Name === other
return @labels.join == other.to_a.join && @absolute == other.absolute?
return @labels.join('.') == other.to_a.join('.') &&
@absolute == other.absolute?
end
alias eql? == # :nodoc:

View file

@ -177,4 +177,10 @@ class TestResolvDNS < Test::Unit::TestCase
end
end
end
def test_case_insensitive_name
name1 = Resolv::DNS::Name.create("example.org")
name2 = Resolv::DNS::Name.create("ex.ampl.eo.rg")
assert_not_equal(name1, name2, "different dots")
end
end