From 8ff33e56a2cf1db78cdcad17fb2027b146c4ee0a Mon Sep 17 00:00:00 2001 From: gogotanaka Date: Wed, 29 Oct 2014 00:32:38 -0700 Subject: [PATCH 2/3] Add test for Vector#[] --- test/matrix/test_vector.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/matrix/test_vector.rb b/test/matrix/test_vector.rb index a063d2c..0448dac 100644 --- a/test/matrix/test_vector.rb +++ b/test/matrix/test_vector.rb @@ -61,7 +61,10 @@ class TestVector < Test::Unit::TestCase assert_equal(2, @v1[1]) assert_equal(3, @v1[2]) assert_equal(3, @v1[-1]) - assert_equal(nil, @v1[3]) + assert_equal(Vector[1, 2], @v1[0..1]) + assert_equal(Vector[2, 3], @v1[1..-1]) + assert_nil(@v1[10..11]) + assert_nil(@v1[3]) end def test_size -- 1.8.5.2 (Apple Git-48)