From f4e4f784ce2f32e0a50fa53fa3b537ff68220289 Mon Sep 17 00:00:00 2001 From: Michael Reed <18372368+chakravala@users.noreply.github.com> Date: Sun, 24 Feb 2019 12:16:26 -0500 Subject: [PATCH] improved test compatibility with Julia v0.7 --- src/Grassmann.jl | 2 ++ src/algebra.jl | 14 +++++++------- test/runtests.jl | 7 +++++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Grassmann.jl b/src/Grassmann.jl index 1911d47..e5caba4 100644 --- a/src/Grassmann.jl +++ b/src/Grassmann.jl @@ -25,6 +25,8 @@ Base.firstindex(a::T) where T<:SubAlgebra = 1 Base.lastindex(a::T) where T<:SubAlgebra{V} where V = 1< sparse_limit N = n-sparse_limit @@ -345,8 +345,8 @@ for (parity,T) ∈ ((:interior,Tuple{Bool,Bits,Bool}),(:regressive,Tuple{Bool,Bi @inbounds $cache[n][m1][s][a1][b+1] end end - @pure $parity(a::Bits,b::Bits,v::VectorSpace) = $parity(ndims(v),DirectSum.options(v),value(v),a,b) - @pure $parity(a::Basis{V,G,B},b::Basis{V,L,C}) where {V,G,B,L,C} = $parity(ndims(V),DirectSum.options(V),value(V),bits(a),bits(b)) + @pure $par(a::Bits,b::Bits,v::VectorSpace) = $par(ndims(v),DirectSum.options(v),value(v),a,b) + @pure $par(a::Basis{V,G,B},b::Basis{V,L,C}) where {V,G,B,L,C} = $par(ndims(V),DirectSum.options(V),value(V),bits(a),bits(b)) end end diff --git a/test/runtests.jl b/test/runtests.jl index 302131e..67aa51f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,8 +4,11 @@ using Test # write your own tests here @test (@basis "++++" s e; e124 * e23 == e134) @test [Λ(3).v32^2,Λ(3).v13^2,Λ(3).v21^2] == [-1Λ(3).v for j∈1:3] -@test ((Λ(2).v1+2Λ(2).v2)∧(3Λ(2).w1+4Λ(2).w2))(Λ(2).v1+Λ(2).v2) == 7Λ(2).v1+14Λ(2).v2+0Λ(2).w1 +@test ((Λ(2).v1+2Λ(2).v2)∧(3Λ(2).w1+4Λ(2).w2))(Λ(2).v1+Λ(2).v2) == 7Λ(2).v1+14Λ(2).v2 @test (@basis "++++"; ((v1*v1,v1⋅v1,v1∧v1) == (1,1,0)) && ((v2*v2,v2⋅v2,v2∧v2) == (1,1,0))) @test (@basis "-+++"; ((v1*v1,v1⋅v1,v1∧v1)==(-1,-1,0)) && ((v2*v2,v2⋅v2,v2∧v2) == (1,1,0))) @test (basis"-+++"; h = 1v1+2v2; h⋅h == 3v) -@test Algebra.:+((:a*Λ(2).v1 + :b*Λ(2).v2) ∧ (:c*Λ(2).v1 + :d*Λ(2).v2),Λ(2).v) == Λ(2).v+:(a*d-b*c)*Λ(2).v12 +!Sys.iswindows() && @test Λ(62).v32a87Ng == -1Λ(62).v2378agN +@test Λ.V3 == Λ.C3' +@test Λ(14) + Λ(14)' == Λ(VectorSpace(14)+VectorSpace(14)') +@test ((a,b) = ((:a*Λ(2).v1 + :b*Λ(2).v2),(:c*Λ(2).v1 + :d*Λ(2).v2)); Algebra.:+(a∧b,a⋅b)==a*b)