1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-11-19 06:30:29 +01:00

fix tests

This commit is contained in:
kalmar 2017-07-05 16:26:35 +02:00
parent 5d51855d17
commit acbaa148bf
2 changed files with 12 additions and 11 deletions

View File

@ -14,7 +14,7 @@
@test isa(Groups.flip_autsymbol(3), Groups.AutSymbol) @test isa(Groups.flip_autsymbol(3), Groups.AutSymbol)
end end
a,b,c,d = generators(FreeGroup(4)) a,b,c,d = Nemo.gens(FreeGroup(4))
domain = [a,b,c,d] domain = [a,b,c,d]
@testset "flip_autsymbol correctness" begin @testset "flip_autsymbol correctness" begin
@ -89,13 +89,13 @@
@test isa(AutGroup(FreeGroup(3)), Nemo.Group) @test isa(AutGroup(FreeGroup(3)), Nemo.Group)
@test isa(AutGroup(FreeGroup(1)), Groups.FPGroup) @test isa(AutGroup(FreeGroup(1)), Groups.FPGroup)
A = AutGroup(FreeGroup(1)) A = AutGroup(FreeGroup(1))
@test isa(generators(A), Vector{AutGroupElem}) @test isa(Nemo.gens(A), Vector{AutGroupElem})
@test length(generators(A)) == 1 @test length(Nemo.gens(A)) == 1
A = AutGroup(FreeGroup(1), special=true) A = AutGroup(FreeGroup(1), special=true)
@test length(generators(A)) == 0 @test length(Nemo.gens(A)) == 0
A = AutGroup(FreeGroup(2)) A = AutGroup(FreeGroup(2))
@test length(generators(A)) == 7 @test length(Nemo.gens(A)) == 7
gens = generators(A) gens = Nemo.gens(A)
@test isa(A(Groups.rmul_autsymbol(1,2)), AutGroupElem) @test isa(A(Groups.rmul_autsymbol(1,2)), AutGroupElem)
@test A(Groups.rmul_autsymbol(1,2)) in gens @test A(Groups.rmul_autsymbol(1,2)) in gens
@ -159,13 +159,13 @@
@test isa(S, Vector{Groups.AutSymbol}) @test isa(S, Vector{Groups.AutSymbol})
S = [G(s) for s in unique(S)] S = [G(s) for s in unique(S)]
@test isa(S, Vector{AutGroupElem}) @test isa(S, Vector{AutGroupElem})
@test S == generators(G) @test S == Nemo.gens(G)
@test length(S) == 51 @test length(S) == 51
S_inv = [S..., [inv(s) for s in S]...] S_inv = [S..., [inv(s) for s in S]...]
@test length(unique(S_inv)) == 75 @test length(unique(S_inv)) == 75
G = AutGroup(FreeGroup(N), special=true, outer=true) G = AutGroup(FreeGroup(N), special=true, outer=true)
S = generators(G) S = Nemo.gens(G)
S_inv = [G(), S..., [inv(s) for s in S]...] S_inv = [G(), S..., [inv(s) for s in S]...]
S_inv = unique(S_inv) S_inv = unique(S_inv)
B_2 = [i*j for (i,j) in Base.product(S_inv, S_inv)] B_2 = [i*j for (i,j) in Base.product(S_inv, S_inv)]

View File

@ -57,11 +57,11 @@ end
@test length(G.gens) == 2 @test length(G.gens) == 2
@test_skip eltype(G.rels) == FreeGroupElem @test_skip eltype(G.rels) == FreeGroupElem
@test_skip length(G.rels) == 0 @test_skip length(G.rels) == 0
@test eltype(generators(G)) == FreeGroupElem @test eltype(Nemo.gens(G)) == FreeGroupElem
@test length(generators(G)) == 2 @test length(Nemo.gens(G)) == 2
end end
s, t = generators(G) s, t = Nemo.gens(G)
@testset "internal arithmetic" begin @testset "internal arithmetic" begin
t_symb = Groups.FreeSymbol("t") t_symb = Groups.FreeSymbol("t")
@ -119,6 +119,7 @@ end
@test Groups.is_subsymbol(a, Groups.change_pow(a,-2)) == false @test Groups.is_subsymbol(a, Groups.change_pow(a,-2)) == false
@test Groups.is_subsymbol(b, Groups.change_pow(a,-2)) == false @test Groups.is_subsymbol(b, Groups.change_pow(a,-2)) == false
@test Groups.is_subsymbol(inv(b), Groups.change_pow(b,-2)) == true @test Groups.is_subsymbol(inv(b), Groups.change_pow(b,-2)) == true
c = s*t*s^-1*t^-1 c = s*t*s^-1*t^-1
@test findfirst(c, s^-1*t^-1) == 3 @test findfirst(c, s^-1*t^-1) == 3
@test findnext(c*s^-1, s^-1*t^-1,3) == 3 @test findnext(c*s^-1, s^-1*t^-1,3) == 3