diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-06 17:45:28 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-06 17:45:28 +0000 |
commit | 1657d516e92002a009b52d992529a04abd33a0ce (patch) | |
tree | fdbe4b5a674b997454d4c985b5cf7c27c2b80d6b /test/matrix | |
parent | a5b6bde856aa69efee9d0c9e76a649c2753dba66 (diff) |
* test/matrix/test_matrix: Add tests for trivial cases [fix GH-576]
Patch by gogotanaka
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/matrix')
-rw-r--r-- | test/matrix/test_matrix.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/matrix/test_matrix.rb b/test/matrix/test_matrix.rb index 50ab00cca7..575b7b0cd6 100644 --- a/test/matrix/test_matrix.rb +++ b/test/matrix/test_matrix.rb @@ -155,7 +155,9 @@ class TestMatrix < Test::Unit::TestCase end def test_inverse + assert_equal(Matrix.empty(0, 0), Matrix.empty.inverse) assert_equal(Matrix[[-1, 1], [0, -1]], Matrix[[-1, -1], [0, -1]].inverse) + assert_raise(ExceptionForMatrix::ErrDimensionMismatch) { @m1.inverse } end def test_determinant @@ -185,6 +187,7 @@ class TestMatrix < Test::Unit::TestCase end def test_scalar + assert_equal(Matrix.empty(0, 0), Matrix.scalar(0, 1)) assert_equal(Matrix[[2,0,0],[0,2,0],[0,0,2]], Matrix.scalar(3, 2)) assert_equal(Matrix[[2,0,0,0],[0,2,0,0],[0,0,2,0],[0,0,0,2]], Matrix.scalar(4, 2)) end |