We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d53c545 commit e6fb452Copy full SHA for e6fb452
spec/ruby/core/string/comparison_spec.rb
@@ -75,6 +75,10 @@
75
(xff_1 <=> xff_2).should == -1
76
(xff_2 <=> xff_1).should == 1
77
end
78
+
79
+ it "returns 0 when comparing 2 empty strings but one is not ASCII-compatible" do
80
+ ("" <=> "".force_encoding('iso-2022-jp')).should == 0
81
+ end
82
83
84
# Note: This is inconsistent with Array#<=> which calls #to_ary instead of
spec/ruby/core/string/shared/eql.rb
@@ -31,4 +31,8 @@
31
a.send(@method, b).should be_true
32
b.send(@method, a).should be_true
33
34
35
+ it "returns true when comparing 2 empty strings but one is not ASCII-compatible" do
36
+ "".send(@method, "".force_encoding('iso-2022-jp')).should == true
37
38
0 commit comments