Skip to content

Commit

Permalink
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions spec/regression/GH-1675_casecmp_on_UTF16LE_encoded_string_spec.rb
Original file line number Diff line number Diff line change
@@ -2,17 +2,13 @@
if RUBY_VERSION > '1.9'
describe 'String#casecmp' do
it 'returns correct value' do
Encoding.name_list.each do |enc_name|
if (enc_name != "UTF-7") && (enc_name != "CP65000")
# this condition statement escape the following error:
# Encoding::ConverterNotFoundError:
# code converter not found for UTF-7
Encoding.list.each do |enc|
next if enc.dummy?

# using "UTF-16LE", "UTF-8", "Shift_JIS", and other available encodings
a = 'ABC'.encode(enc_name)
b = 'ABC'.encode(enc_name)
b.casecmp(a).should be_true
end
# using "UTF-16LE", "UTF-8", "Shift_JIS", and other available encodings
a = 'ABC'.encode(enc)
b = 'ABC'.encode(enc)
b.casecmp(a).should be_true
end
end
end

0 comments on commit 9aa2238

Please sign in to comment.