From d230fd817195acd918ca50c29ba52439020777db Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 23 Jan 2018 12:35:49 +0100 Subject: [PATCH] Fix one IsPNilpotent method, and add some tests --- lib/grp.gi | 2 +- tst/testinstall/opers/IsPNilpotent.tst | 15 ++++++++++ tst/testinstall/opers/SimpleGroup.tst | 28 +++++++++++++++++ tst/testinstall/opers/SubdirectProducts.tst | 33 +++++++++++++++++++++ 4 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 tst/testinstall/opers/IsPNilpotent.tst create mode 100644 tst/testinstall/opers/SimpleGroup.tst create mode 100644 tst/testinstall/opers/SubdirectProducts.tst diff --git a/lib/grp.gi b/lib/grp.gi index 2a673a869d..5d6a2aa22e 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -2622,7 +2622,7 @@ InstallMethod( IsPNilpotentOp, local primes, S; primes:= PrimeDivisors( Size( G ) ); - RemoveSet( primes, p ); + primes:= Filtered(primes, q -> q <> p ); S:= HallSubgroup( G, primes ); return S <> fail and IsNormal( G, S ); diff --git a/tst/testinstall/opers/IsPNilpotent.tst b/tst/testinstall/opers/IsPNilpotent.tst new file mode 100644 index 0000000000..9511f8ae8c --- /dev/null +++ b/tst/testinstall/opers/IsPNilpotent.tst @@ -0,0 +1,15 @@ +gap> START_TEST("IsPNilpotent.tst"); + +# +gap> G:=SymmetricGroup(3);; +gap> List([2,3,5], p -> IsPNilpotent(G,p)); +[ true, false, true ] + +# +gap> G:=SymmetricGroup(3);; +gap> SpecialPcgs(G);; +gap> List([2,3,5], p -> IsPNilpotent(G,p)); +[ true, false, true ] + +# +gap> STOP_TEST("IsPNilpotent.tst", 10000); diff --git a/tst/testinstall/opers/SimpleGroup.tst b/tst/testinstall/opers/SimpleGroup.tst new file mode 100644 index 0000000000..9bc119eb67 --- /dev/null +++ b/tst/testinstall/opers/SimpleGroup.tst @@ -0,0 +1,28 @@ +gap> START_TEST("SimpleGroup.tst"); + +# +gap> SimpleGroup("Sz(8)"); +Sz(8) +gap> SimpleGroup("Suzuki(32)"); +Sz(32) +gap> SimpleGroup("Suz(8)"); +Sz(8) +gap> SimpleGroup("Sz(9)"); +Error, Illegal Parameter for Suzuki groups +gap> SimpleGroup("Suz(16)"); +Error, Illegal Parameter for Suzuki groups + +# +gap> SimpleGroup("R(27)"); +Ree(27) +gap> SimpleGroup("Ree(27)"); +Ree(27) +gap> SimpleGroup("2G(243)"); +Ree(243) +gap> SimpleGroup("Ree(9)"); +Error, Illegal Parameter for Ree groups +gap> SimpleGroup("Ree(16)"); +Error, Illegal Parameter for Ree groups + +# +gap> STOP_TEST("SimpleGroup.tst", 10000); diff --git a/tst/testinstall/opers/SubdirectProducts.tst b/tst/testinstall/opers/SubdirectProducts.tst new file mode 100644 index 0000000000..71b5f1fd42 --- /dev/null +++ b/tst/testinstall/opers/SubdirectProducts.tst @@ -0,0 +1,33 @@ +gap> START_TEST("SubdirectProducts.tst"); +gap> G := SymmetricGroup(3);; +gap> H := SymmetricGroup(4);; +gap> A := CyclicGroup(6);; + +# +gap> Set(SubdirectProducts(G, G), IdGroup); +[ [ 6, 1 ], [ 18, 4 ], [ 36, 10 ] ] +gap> Set(SubdirectProducts(H, H), IdGroup); +[ [ 24, 12 ], [ 96, 227 ], [ 288, 1026 ], [ 576, 8653 ] ] +gap> Set(SubdirectProducts(A, A), IdGroup); +[ [ 6, 2 ], [ 12, 5 ], [ 18, 5 ], [ 36, 14 ] ] + +# +gap> Set(SubdirectProducts(G, H), IdGroup); +[ [ 24, 12 ], [ 72, 43 ], [ 144, 183 ] ] +gap> Set(SubdirectProducts(H, G), IdGroup); +[ [ 24, 12 ], [ 72, 43 ], [ 144, 183 ] ] + +# +gap> Set(SubdirectProducts(G, A), IdGroup); +[ [ 18, 3 ], [ 36, 12 ] ] +gap> Set(SubdirectProducts(A, G), IdGroup); +[ [ 18, 3 ], [ 36, 12 ] ] + +# +gap> Set(SubdirectProducts(H, A), IdGroup); +[ [ 72, 42 ], [ 144, 188 ] ] +gap> Set(SubdirectProducts(A, H), IdGroup); +[ [ 72, 42 ], [ 144, 188 ] ] + +# +gap> STOP_TEST("SubdirectProducts.tst", 10000);