diff --git a/lib/pperm.gi b/lib/pperm.gi index 6a652b55f53..40c2cea1ca6 100644 --- a/lib/pperm.gi +++ b/lib/pperm.gi @@ -545,12 +545,13 @@ function(arg) fi; elif Length(arg)=2 then if IsSSortedList(arg[1]) and ForAll(arg[1], IsPosInt) and - IsDuplicateFreeList(arg[2]) and ForAll(arg[2], IsPosInt) then + IsDuplicateFreeList(arg[2]) and ForAll(arg[2], IsPosInt) and + Length(arg[1]) = Length(arg[2]) then return SparsePartialPermNC(arg[1], arg[2]); else ErrorNoReturn("usage: the 1st argument must be a set of positive integers ", "and the 2nd argument must be a duplicate-free list of positive ", - "integers"); + "integers of equal length to the first"); fi; fi; diff --git a/tst/testinstall/pperm.tst b/tst/testinstall/pperm.tst index 309ca6315a0..6d0a0990afb 100644 --- a/tst/testinstall/pperm.tst +++ b/tst/testinstall/pperm.tst @@ -2440,6 +2440,12 @@ gap> MultiplicativeZeroOp(x); gap> MultiplicativeZero(x); +# Test PartialPerm (for sparse incorrect arg) +gap> PartialPerm([1,2,8],[3,4,1,2]); +Error, usage: the 1st argument must be a set of positive integers and the 2nd \ +argument must be a duplicate-free list of positive integers of equal length to\ + the first + # gap> SetUserPreference("PartialPermDisplayLimit", display);; gap> SetUserPreference("NotationForPartialPerm", notationpp);;