1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix matrix spec for 7d360efe92

This commit is contained in:
Takashi Kokubun 2020-05-01 00:45:17 -07:00
parent 5c8bfad078
commit 76507bfc3d
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD

View file

@ -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