Skip to content

Commit 9d05f78

Browse files
committed
Fix miss testing
``` '\u{e4 f6 fc}'.encode('ISO-8859-1').to_sym.casecmp?(:'\u{c4 d6 dc}') => false ```
1 parent d39675d commit 9d05f78

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

test/stdlib/Symbol_test.rb

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,12 @@ def test_casecmp
134134
def test_casecmp?
135135
%i[a A s S z Z].each do |other|
136136
assert_send_type '(Symbol) -> bool',
137-
:s, :casecmp?, other
138-
end
139-
140-
# invalid encoding
141-
assert_send_type '(Symbol) -> nil',
142-
'\u{e4 f6 fc}'.encode('ISO-8859-1').to_sym, :casecmp?, :'\u{c4 d6 dc}'
143-
144-
with_untyped.and :sym do |other|
145-
assert_send_type '(untyped) -> bool?',
146-
:a, :casecmp?, other
137+
:s, :casecmp?, other
147138
end
139+
assert_send_type '(String) -> nil',
140+
:abc, :casecmp?, "abc"
141+
assert_send_type '(Integer) -> nil',
142+
:abc, :casecmp?, 1
148143
end
149144

150145
def test_downcase
@@ -177,7 +172,7 @@ def test_encoding
177172
def test_end_with?
178173
assert_send_type '() -> bool',
179174
:a, :end_with?
180-
175+
181176
with_string 'a' do |string_a|
182177
assert_send_type '(string) -> true',
183178
:a, :end_with?, string_a

0 commit comments

Comments
 (0)