diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2020-05-01 00:45:17 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2020-05-01 00:45:17 -0700 |
commit | 76507bfc3d06984b02e3124cd6557c81af2171cd (patch) | |
tree | 6d3ea10b35204ccdd7a3c5922ac5bb3a801868a2 | |
parent | 5c8bfad078bf37797256f3214b29c578ac763109 (diff) | |
download | ruby-76507bfc3d06984b02e3124cd6557c81af2171cd.tar.gz |
Fix matrix spec for 7d360efe92d2db11a4e51820ed2f52de36b3257f
-rw-r--r-- | spec/ruby/library/matrix/unitary_spec.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/ruby/library/matrix/unitary_spec.rb b/spec/ruby/library/matrix/unitary_spec.rb index 9c2a106ea5..b0c23e0e84 100644 --- a/spec/ruby/library/matrix/unitary_spec.rb +++ b/spec/ruby/library/matrix/unitary_spec.rb @@ -5,10 +5,15 @@ describe "Matrix.unitary?" do it "returns false for non unitary matrices" do Matrix[[0, 1], [1, 2]].unitary?.should == false Matrix[[0, Complex(0, 2)], [Complex(0, 2), 0]].unitary?.should == false - Matrix[[0, Complex(0, 1)], [Complex(0, -1), 0]].unitary?.should == false Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].unitary?.should == false end + ruby_version_is '2.8' do # matrix v0.3.0 + it "returns false for non unitary matrix" do + Matrix[[0, Complex(0, 1)], [Complex(0, -1), 0]].unitary?.should == true + end + end + it "returns true for unitary matrices" do Matrix[[0, Complex(0, 1)], [Complex(0, 1), 0]].unitary?.should == true end |