From a2ae7bccf8670865fddbfc1aa7f30ab536bb4814 Mon Sep 17 00:00:00 2001 From: marcandre Date: Tue, 7 Oct 2014 20:18:35 +0000 Subject: * lib/matrix.rb: Add @- and @+ for Matrix and Vector. patch by gogo tanaka [#10068] [#10069] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/matrix/test_matrix.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/matrix/test_matrix.rb') diff --git a/test/matrix/test_matrix.rb b/test/matrix/test_matrix.rb index 2d99cead42..79ae9b965b 100644 --- a/test/matrix/test_matrix.rb +++ b/test/matrix/test_matrix.rb @@ -62,6 +62,15 @@ class TestMatrix < Test::Unit::TestCase assert_equal @m1.hash, @m3.hash end + def test_uplus + assert_equal(@m1, +@m1) + end + + def test_negate + assert_equal(Matrix[[-1, -2, -3], [-4, -5, -6]], -@m1) + assert_equal(@m1, -(-@m1)) + end + def test_rank [ [[0]], -- cgit v1.2.3