mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merge revision(s) 49071-49073,49078: [Backport #10550]
* lib/resolv.rb (Resolv::DNS::Name#==): DNS is case-insensitive, so the comparison should be case-insensitive as well. [ruby-core:66498] [Bug #10550] * lib/resolv.rb (Resolv::DNS::Name): names with different dots should be different. * lib/resolv.rb (Resolv::DNS::Name#==): Compare an array of Label:Str objects. Label#Str#== is case-insensitive. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@49252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f9d88c6059
commit
568a5d520b
4 changed files with 32 additions and 2 deletions
16
ChangeLog
16
ChangeLog
|
|
@ -1,3 +1,19 @@
|
|||
Wed Jan 14 16:48:15 2015 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* lib/resolv.rb (Resolv::DNS::Name#==): Compare an array of Label:Str
|
||||
objects. Label#Str#== is case-insensitive.
|
||||
|
||||
Wed Jan 14 16:48:15 2015 Ben Miller <bmiller@rackspace.com>
|
||||
|
||||
* lib/resolv.rb (Resolv::DNS::Name#==): DNS is case-insensitive, so the
|
||||
comparison should be case-insensitive as well.
|
||||
[ruby-core:66498] [Bug #10550]
|
||||
|
||||
Wed Jan 14 16:48:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/resolv.rb (Resolv::DNS::Name): names with different dots
|
||||
should be different.
|
||||
|
||||
Wed Jan 14 16:30:51 2015 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* lib/net/http/response.rb (Net::HTTPResponse): require one or more
|
||||
|
|
|
|||
|
|
@ -1209,7 +1209,8 @@ class Resolv
|
|||
|
||||
def ==(other) # :nodoc:
|
||||
return false unless Name === other
|
||||
return @labels.join == other.to_a.join && @absolute == other.absolute?
|
||||
return false unless @absolute == other.absolute?
|
||||
return @labels == other.to_a
|
||||
end
|
||||
|
||||
alias eql? == # :nodoc:
|
||||
|
|
|
|||
|
|
@ -175,4 +175,17 @@ class TestResolvDNS < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_dots_diffences
|
||||
name1 = Resolv::DNS::Name.create("example.org")
|
||||
name2 = Resolv::DNS::Name.create("ex.ampl.eo.rg")
|
||||
assert_not_equal(name1, name2, "different dots")
|
||||
end
|
||||
|
||||
def test_case_insensitive_name
|
||||
bug10550 = '[ruby-core:66498] [Bug #10550]'
|
||||
lower = Resolv::DNS::Name.create("ruby-lang.org")
|
||||
upper = Resolv::DNS::Name.create("Ruby-Lang.org")
|
||||
assert_equal(lower, upper, bug10550)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#define RUBY_VERSION "2.0.0"
|
||||
#define RUBY_RELEASE_DATE "2015-01-14"
|
||||
#define RUBY_PATCHLEVEL 612
|
||||
#define RUBY_PATCHLEVEL 613
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2015
|
||||
#define RUBY_RELEASE_MONTH 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue