Skip to content

Commit

Permalink
skip tests on 1.0, and add a few
Browse files Browse the repository at this point in the history
  • Loading branch information
mcabbott committed Apr 13, 2021
1 parent e95f3e8 commit caaba9d
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,44 @@ end
@test unit(first(M * v)) == u"m*V"
@test M * v == M_ * v == M * v_ == M_ * v_

@test CNT[] == 10
VERSION >= v"1.3" && @test CNT[] == 10

@test unit(first(v' * M)) == u"m*V"
@test v' * M == v_' * M == v_' * M == v_' * M_

@test CNT[] == 15
VERSION >= v"1.3" && @test CNT[] == 15

@test unit(v' * v) == u"V*V"
@test v' * v == v_' * v == v_' * v == v_' * v_

@test CNT[] == 20
VERSION >= v"1.3" && @test CNT[] == 20

# Mixed with & without units
N = rand(3,3)
w = rand(3)

CNT[] = 0

@test unit(first(M * N)) == u"m"
@test unit(first(N * M)) == u"m"

@test unit(first(M * w)) == u"m"
@test unit(first(N * v)) == u"V"

@show CNT[] # not specialised yet

end
@testset "> Matrix multiplication: mul!" begin
A = rand(3,3) .* u"m"
B = rand(3,3) .* u"m"
C = fill(zero(eltype(A*B)), 3, 3)
CNT[] = 0

mul!(C, A, B)
mul!(C, A, B, true, true)
mul!(C, A, B, 3, 7) # not specialised yet

@show CNT[]
end
end

Expand Down

0 comments on commit caaba9d

Please sign in to comment.