From 2a359f52b1d6e0e45b2115d6f9617de9b2b9fcf9 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Thu, 3 Jan 2019 02:43:48 +0100 Subject: [PATCH] additional tests for WreathProducts --- test/WreathProd-tests.jl | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/test/WreathProd-tests.jl b/test/WreathProd-tests.jl index b52b552..2c3e183 100644 --- a/test/WreathProd-tests.jl +++ b/test/WreathProd-tests.jl @@ -22,6 +22,8 @@ @test B3.P == S_3 @test B3(aa, b) == Groups.WreathProductElem(aa, b) + w = B3(aa, b) + @test B3(w) == w @test B3(b) == Groups.WreathProductElem(B3.N(), b) @test B3(aa) == Groups.WreathProductElem(aa, S_3()) @@ -78,19 +80,23 @@ @test inv(x)*y == B4((2,1,2,2), perm"(1,2,4)(3)") @test y*inv(x) == B4((1,2,1,0), perm"(1,4,3)(2)") + + @test (x*y)^6 == ((x*y)^2)^3 end - @testset "Misc" begin - B3 = Groups.WreathProduct(AdditiveGroup(GF(3)), S_3) - @test order(B3) == 3^3*6 - @test collect(B3) isa Vector{ + @testset "Iteration" begin + B3_a = Groups.WreathProduct(AdditiveGroup(GF(3)), S_3) + @test order(B3_a) == 3^3*6 + @test collect(B3_a) isa Vector{ WreathProductElem{3, AddGrpElem{AbstractAlgebra.gfelem{Int}}, Int}} - B3 = Groups.WreathProduct(MultiplicativeGroup(GF(3)), S_3) - @test order(B3) == 2^3*6 - @test collect(B3) isa Vector{ + B3_m = Groups.WreathProduct(MultiplicativeGroup(GF(3)), S_3) + @test order(B3_m) == 2^3*6 + @test collect(B3_m) isa Vector{ WreathProductElem{3, MltGrpElem{AbstractAlgebra.gfelem{Int}}, Int}} + + @test length(Set([B3_a, B3_m, B3_a])) == 2 Wr = WreathProduct(PermutationGroup(2),PermutationGroup(4)) @@ -102,5 +108,18 @@ @test all([g*inv(g) == Wr() for g in elts]) @test all(inv(g*h) == inv(h)*inv(g) for g in elts for h in elts) end + + @testset "Misc" begin + B3_a = Groups.WreathProduct(AdditiveGroup(GF(3)), S_3) + @test string(B3_a) == "Wreath Product of The additive group of Finite field F_3 by Permutation group over 3 elements" + + @test string(B3_a(perm"(1,3)")) == "([0,0,0]≀(1,3))" + + B3_m = Groups.WreathProduct(MultiplicativeGroup(GF(3)), S_3) + @test string(B3_m) == "Wreath Product of The multiplicative group of Finite field F_3 by Permutation group over 3 elements" + + @test string(B3_m(perm"(1,3)")) == "([1,1,1]≀(1,3))" + + end end