Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# GH-3155
describe "Array#map with delete inside the loop" do
it "must not produce invalid array contents" do
array = [1, 2, 3]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
it "has arity one" do
expect([].method(:repeated_permutation).arity).to eq(1)
end
end if RUBY_VERSION >= "1.9"
end
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'rspec'

# GH-6864
# JRuby has separate codepaths for 1 char and >1 char.
describe "A Range of strings >1 char long" do
it "works" do
Expand Down
13 changes: 13 additions & 0 deletions 13 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,6 +1,7 @@
require 'rspec'

describe "shared string generated by crypt" do
# This split will have the same byte-backed buffer because of COW
subject {
'abc,def,ghi'.split(',')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
expect(ary.length).to eq 6
expect(ary).to eq(['M', "\xA1", 'x', 'i', 'c', 'o'].map{|c| c.force_encoding('ASCII')})
end
end unless RUBY_VERSION < '1.9'
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
expect(formatted).to eq("1 ø")
expect(formatted.encoding).to eq(Encoding::UTF_8)
end
end if RUBY_VERSION >= '1.9'
end

Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# -*- coding: utf-8 -*-
require 'rspec'
# encoding: utf-8
# GH-1087: String#index with regex and multi-byte characters returns wrong index
# https://github.com/jruby/jruby/issues/1087

describe 'String#index given a Regexp and an index past the last character' do
it "returns nil" do
# without multibyte
str = "strings - strings"
expect(str.index(/\b/, 18)).to eq(nil)

# with multibyte
str = "ßt®íngß — ßt®íngß"
expect(str.index(/\b/, 18)).to eq(nil)
end
end


describe 'JRUBY-6863' do
let(:str) do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# GH-1072
describe "DateTime plus a numeric value larger than int range" do
it "correctly uses long logic to do the addition" do
date = DateTime.new(2011,1,1)
expect(date + Rational(365,1)).to eq(DateTime.new(2012,1,1))
end
end
end

This file was deleted.

15 changes: 0 additions & 15 deletions 15 spec/regression/GH-1675_casecmp_on_UTF16LE_encoded_string_spec.rb

This file was deleted.

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

This file was deleted.

21 changes: 0 additions & 21 deletions 21 spec/regression/random_rand_spec.rb

This file was deleted.

Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.