Rails2.7 segfaults (#7091)

* Add a test suite for ruby 2.7

* Call BigDecimal() instead of BigDecimal.new()

BigDecimal.new was deprecated in ruby 2.6

* Switch FrozenError expectation to a matcher

The error message for FrozenError changed to include more information
about the mutated object. Switch from an exact match to an aproximate
match (equal => match). This does not change the prefix.

* We can safely ignore newest array methods from ruby 2.7
pull/7397/head
Eric Walker 5 years ago committed by GitHub
parent 64f6c59ccb
commit 2c8364bcd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ruby/tests/common_tests.rb
  2. 1
      ruby/tests/repeated_field_test.rb
  3. 4
      tests.sh

@ -1739,7 +1739,7 @@ module CommonTests
m.freeze
frozen_error = assert_raise(FrozenErrorType) { m.optional_int32 = 20 }
assert_equal "can't modify frozen #{proto_module}::TestMessage", frozen_error.message
assert_match "can't modify frozen #{proto_module}::TestMessage", frozen_error.message
assert_equal 10, m.optional_int32
assert_equal true, m.frozen?

@ -20,6 +20,7 @@ class RepeatedFieldTest < Test::Unit::TestCase
:iter_for_each_with_index, :dimensions, :copy_data, :copy_data_simple,
:nitems, :iter_for_reverse_each, :indexes, :append, :prepend]
arr_methods -= [:union, :difference, :filter!]
arr_methods -= [:intersection, :deconstruct] # ruby 2.7 methods we can ignore
arr_methods.each do |method_name|
assert m.repeated_string.respond_to?(method_name) == true, "does not respond to #{method_name}"
end

@ -436,6 +436,10 @@ build_ruby26() {
internal_build_cpp # For conformance tests.
cd ruby && bash travis-test.sh ruby-2.6.0 && cd ..
}
build_ruby27() {
internal_build_cpp # For conformance tests.
cd ruby && bash travis-test.sh ruby-2.7.0 && cd ..
}
build_javascript() {
internal_build_cpp

Loading…
Cancel
Save