Skip to content

Commit

Permalink
gprd.gi: fix assertion in PrimePGroup
Browse files Browse the repository at this point in the history
Resolves #1719
  • Loading branch information
wilfwilson authored and fingolfin committed Sep 13, 2017
1 parent 277cf32 commit 6e7b104
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/gprd.gi
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,12 @@ end );
InstallMethod( PrimePGroup, "for direct products",
[IsPGroup and HasDirectProductInfo],
function( D )
local p;
Assert (1, ForAll (DirectProductInfo( D ).groups, IsPGroup));
p := First (DirectProductInfo( D ).groups, G -> PrimePGroup (G) <> fail);
Assert (1, ForAll (DirectProductInfo( D ).groups, G -> PrimePGroup (G) in [fail, p]));
return PrimePGroup(p);
local groups, p;
groups := DirectProductInfo(D).groups;
Assert(1, ForAll(groups, IsPGroup));
p := PrimePGroup(First(groups, G -> PrimePGroup(G) <> fail));
Assert(1, ForAll(groups, G -> PrimePGroup(G) in [fail, p]));
return p;
end );

#############################################################################
Expand Down
11 changes: 11 additions & 0 deletions tst/testbugfix/2017-09-13-PrimePGroup.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Issue related to PrimePGroup for filter IsPGroup and HasDirectProductInfo
# Examples reported on issue #1719 on github.com/gap-system/gap
#
gap> level := AssertionLevel();;
gap> SetAssertionLevel(1);
gap> G := CyclicGroup(IsPcGroup, 5);;
gap> H := Range(IsomorphismPermGroup(G));
Group([ (1,2,3,4,5) ])
gap> PrimePGroup(H);
5
gap> SetAssertionLevel(level);;

0 comments on commit 6e7b104

Please sign in to comment.