From 94ea907d2581000ecef3a422ee038eac2c403b77 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 9 Sep 2022 13:19:09 +0200 Subject: [PATCH] Fix unexpected error in `MinimalGeneratingSet` for solvable non-pc groups It could end up returning nothing and not invoking TryNextMethod(). This caused a failure in the hap test suite. This is a recent regression in 4.12.0. --- lib/grp.gi | 4 ++-- tst/testbugfix/2022-09-09-MinimalGeneratingSet.tst | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 tst/testbugfix/2022-09-09-MinimalGeneratingSet.tst diff --git a/lib/grp.gi b/lib/grp.gi index 656f6bff1c..1ae704ad62 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -112,7 +112,7 @@ InstallMethod(MinimalGeneratingSet,"test solvable and 2-generator noncyclic", function(G) local i; if not HasIsSolvableGroup(G) and IsSolvableGroup(G) and - CanEasilyComputePcgs(G) then + CanEasilyComputePcgs(G) then # discovered solvable -- redo return MinimalGeneratingSet(G); elif not IsSolvableGroup(G) then @@ -120,8 +120,8 @@ local i; and Length(GeneratorsOfGroup(G)) = 2 then return GeneratorsOfGroup(G); fi; - TryNextMethod(); fi; + TryNextMethod(); end); ############################################################################# diff --git a/tst/testbugfix/2022-09-09-MinimalGeneratingSet.tst b/tst/testbugfix/2022-09-09-MinimalGeneratingSet.tst new file mode 100644 index 0000000000..98d0d13389 --- /dev/null +++ b/tst/testbugfix/2022-09-09-MinimalGeneratingSet.tst @@ -0,0 +1,5 @@ +gap> G:=Group((1,2),(2,3),(3,4));; +gap> H:=Image(IsomorphismFpGroup(G));; +gap> MinimalGeneratingSet(H); +Error, no method found! For debugging hints type ?Recovery from NoMethodFound +Error, no 4th choice method found for `MinimalGeneratingSet' on 1 arguments