Commit 1cda5e07 authored by Masaki Muranaka's avatar Masaki Muranaka

Add tests for coverage.

parent 328353b2
......@@ -65,6 +65,7 @@ assert('Array#[]=', '15.2.12.5.5') do
end
[1,2,3].[]=(1,4) == [1, 4, 3] and
[1,2,3].[]=(1,2,3) == [1, 3] and
e2.class == ArgumentError and
e3.class == ArgumentError
end
......@@ -242,6 +243,21 @@ assert('Array#to_s', '15.2.12.5.31') do
r1 == r2 and r1 == "[2, 3, 4, 5]"
end
assert('Array#==', '15.2.12.5.33') do
r1 = [ "a", "c" ] == [ "a", "c", 7 ] #=> false
r2 = [ "a", "c", 7 ] == [ "a", "c", 7 ] #=> true
r3 = [ "a", "c", 7 ] == [ "a", "d", "f" ] #=> false
r1 == false and r2 == true and r3 == false
end
assert('Array#<=>', '15.2.12.5.36') do
r1 = [ "a", "a", "c" ] <=> [ "a", "b", "c" ] #=> -1
r2 = [ 1, 2, 3, 4, 5, 6 ] <=> [ 1, 2 ] #=> +1
r1 == -1 and r2 == +1
end
# Not ISO specified
assert("Array (Shared Array Corruption)") do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment