Project

General

Profile

Feature #10445 ยป add_test.patch

gogotanaka (Kazuki Tanaka), 10/29/2014 08:26 AM

View differences:

test/matrix/test_matrix.rb
74 74
    assert_equal(@m1, -(-@m1))
75 75
  end
76
  def test_aref
77
    assert_equal(5, @m1[1, 1])
78
    assert_nil(@m1[1, 3])
79

  
80
    assert_equal(Vector[1, 2], @m1[0, 0..1])
81
    assert_equal(Vector[2, 3], @m1[0, 1..-1])
82
    assert_nil(@m1[10, 0..1])
83
    assert_nil(@m1[1, 10..11])
84

  
85
    assert_equal(Vector[2, 5], @m1[0..1, 1])
86
    assert_equal(Vector[3, 6], @m1[0..-1, 2])
87
    assert_nil(@m1[10..11, 1])
88
    assert_nil(@m1[0..1, 10])
89

  
90
    assert_equal(@m1.minor(0..1, 0..1), @m1[0..1, 0..1])
91
  end
92

  
76 93
  def test_rank
77 94
    [
78 95
      [[0]],
79
-