From 27b0a6e5d2d40200361c5820b95f745bf0b851f3 Mon Sep 17 00:00:00 2001 From: kshyatt Date: Fri, 11 Sep 2015 22:24:51 -0700 Subject: [PATCH] Misc tests for generic --- test/linalg/generic.jl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/linalg/generic.jl b/test/linalg/generic.jl index 24499f6accf02..a1ce1a5061419 100644 --- a/test/linalg/generic.jl +++ b/test/linalg/generic.jl @@ -56,10 +56,17 @@ y = ['a','b','c','d','e'] α = 'f' @test_throws DimensionMismatch Base.LinAlg.axpy!(α,x,['g']) @test_throws BoundsError Base.LinAlg.axpy!(α,x,collect(-1:5),y,collect(1:7)) +@test_throws BoundsError Base.LinAlg.axpy!(α,x,collect(1:7),y,collect(-1:5)) +@test_throws ArgumentError Base.LinAlg.axpy!(α,x,collect(1:3),y,collect(1:5)) @test_throws BoundsError Base.LinAlg.axpy!(α,x,collect(1:7),y,collect(1:7)) +@test_throws DimensionMismatch Base.LinAlg.axpy!(α,x,collect(1:2),['a','b'],collect(1:2)) +@test_throws ArgumentError diag(rand(10)) +@test !issym(ones(5,3)) +@test !ishermitian(ones(5,3)) +@test cross(ones(3),ones(3)) == zeros(3) - +@test trace(Bidiagonal(ones(5),zeros(4),true)) == 5 # 2-argument version of scale a = reshape([1.:6;], (2,3)) @@ -116,6 +123,7 @@ for elty in [Float32,Float64,Complex64,Complex128] @test rank(one(elty)) == 1 @test !isfinite(cond(zero(elty))) @test cond(a) == one(elty) + @test cond(a,1) == one(elty) @test issym(a) @test ishermitian(one(elty)) @test det(a) == a @@ -125,6 +133,7 @@ end @test norm([2.4e-322, 4.4e-323]) ≈ 2.47e-322 @test norm([2.4e-322, 4.4e-323], 3) ≈ 2.4e-322 +@test_throws ArgumentError norm(ones(5,5),5) # test generic vecnorm for arrays of arrays let x = Vector{Int}[[1,2], [3,4]]