Skip to content

Commit

Permalink
Add tests for switch tables
Browse files Browse the repository at this point in the history
  • Loading branch information
lkastner committed Oct 18, 2023
1 parent 6b71670 commit ac5a9fb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/groups.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@testset verbose=true "Polymake.Group" begin
@testset verbose=true "Polymake.SwitchTable" begin
ggens = [[1,2,0,4,5,3], [2,1,0,5,4,3]]
gp = Polymake.group.PermutationAction(GENERATORS=ggens)
sw = Polymake.SwitchTable(gp.ALL_GROUP_ELEMENTS)

v1 = convert(Polymake.PolymakeType, [64,64,64,0,0,0])
min1 = Polymake.lex_minimize_vector(sw, v1)
max1 = Polymake.lex_maximize_vector(sw, v1)
@test min1 == max1
@test first(min1) == v1
@test first(max1) == v1
@test first(min1) == Polymake.group.action_inv(last(min1), v1)
@test first(max1) == Polymake.group.action_inv(last(max1), v1)

v2 = convert(Polymake.PolymakeType, [32,36,44,48,32,0])
min2 = Polymake.lex_minimize_vector(sw, v2)
max2 = Polymake.lex_maximize_vector(sw, v2)
@test first(min2) == v2
@test first(min2) == Polymake.group.action_inv(last(min2), v2)
@test first(max2) == Polymake.group.action_inv(last(max2), v2)
end
end
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ include("lists.jl")
include("map.jl")
include("graphs.jl")
include("homologygroup.jl")
include("groups.jl")
if get(ENV, "POLYDB_TEST_URI", "") != ""
include("polydb.jl")
end
Expand Down

0 comments on commit ac5a9fb

Please sign in to comment.