Skip to content
Open
Prev Previous commit
Next Next commit
More String regression specs moved to jruby
  • Loading branch information
enebo committed Sep 4, 2025
commit affff42d36c3b15eabbea58814cb157743a62c5b
13 changes: 13 additions & 0 deletions spec/jruby/core/string/casecmp_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# https://github.com/jruby/jruby/issues/1675
describe 'String#casecmp' do
it 'returns correct value' do
Encoding.list.each do |enc|
next if enc.dummy?

# using "UTF-16LE", "UTF-8", "Shift_JIS", and other available encodings
a = 'ABC'.encode(enc)
b = 'ABC'.encode(enc)
expect(b.casecmp(a)).to be_truthy
end
end
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# coding: utf-8

require 'base64'
require 'rspec'

# https://github.com/jruby/jruby/issues/3402
describe 'String#encode with :replace option' do
it 'returns correct value' do
str = "testing\xC2".encode("UTF-8", :invalid => :replace, :undef => :replace, :replace => "foo123")
expect(str).to eq "testingfoo123"
end
end

describe "A badly-encoded UTF-8 String reencoded with replacements as UTF-16 " do
it "completes for all inputs" do
Expand All @@ -12,4 +23,4 @@
expect(data).to_not eq(nil)
end
end
end unless RUBY_VERSION.index('1.8') == 0
end
15 changes: 0 additions & 15 deletions spec/regression/GH-1675_casecmp_on_UTF16LE_encoded_string_spec.rb

This file was deleted.

12 changes: 0 additions & 12 deletions spec/regression/GH-3402_spec.rb

This file was deleted.

Loading