mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
The method #initialize_copy should be private, no direct call
Fixed test/t/array.rb and test/t/string.rb in standard tests. And mrbgems/mruby-struct/test/struct.rb as well.
This commit is contained in:
@@ -169,7 +169,7 @@ assert("Struct#initialize_copy requires struct to be the same type") do
|
||||
Struct.__send__(:remove_const,:Test)
|
||||
Struct.new("Test", :a, :b)
|
||||
assert_raise(TypeError) do
|
||||
a.initialize_copy(Struct::Test.new("a", "b"))
|
||||
a.__send__(:initialize_copy, Struct::Test.new("a", "b"))
|
||||
end
|
||||
ensure
|
||||
Struct.__send__(:remove_const,:Test)
|
||||
|
||||
+1
-1
@@ -208,7 +208,7 @@ end
|
||||
|
||||
assert('Array#initialize_copy', '15.2.12.5.16') do
|
||||
a = [1,2,3]
|
||||
b = [].initialize_copy(a)
|
||||
b = [].__send__(:initialize_copy, a)
|
||||
|
||||
assert_equal([1,2,3], b)
|
||||
end
|
||||
|
||||
+1
-1
@@ -494,7 +494,7 @@ end
|
||||
|
||||
assert('String#initialize_copy', '15.2.10.5.24') do
|
||||
a = ''
|
||||
a.initialize_copy('abc')
|
||||
a.__send__(:initialize_copy, 'abc')
|
||||
|
||||
assert_equal 'abc', a
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user