mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_array.rb: add test
* test/ruby/test_array.rb (test_last2): add test for Array#last with length argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
111327c535
commit
d0885b5cd8
1 changed files with 5 additions and 0 deletions
|
@ -1794,6 +1794,11 @@ class TestArray < Test::Unit::TestCase
|
|||
assert_raise(ArgumentError) { [0].first(-1) }
|
||||
end
|
||||
|
||||
def test_last2
|
||||
assert_equal([0], [0].last(2))
|
||||
assert_raise(ArgumentError) { [0].last(-1) }
|
||||
end
|
||||
|
||||
def test_shift2
|
||||
assert_equal(0, ([0] * 16).shift)
|
||||
# check
|
||||
|
|
Loading…
Add table
Reference in a new issue