Skip to content

Commit

Permalink
Fix PermList for descending ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed May 4, 2020
1 parent edc5339 commit 7b14c09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/permutat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1080,8 +1080,6 @@ static Obj FuncPermList(Obj self, Obj list)
if (IS_RANGE(list)) {
if (GET_LOW_RANGE(list) == 1 && GET_INC_RANGE(list) == 1)
return IdentityPerm;
else
return Fail;
}
list = PLAIN_LIST_COPY(list);
}
Expand Down
4 changes: 4 additions & 0 deletions tst/testinstall/perm.tst
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@ gap> ForAll(checklens, n -> not(
> PermList(Concatenation([1..n-1], [n+1,n,n+2,n+4,n+3])) =
> PermList(Concatenation([1..n-1], [n+1,n+2,n,n+4,n+3]))));
true
gap> PermList([1..5]);
()
gap> PermList([5,4..1]);
(1,5)(2,4)

# PermList error handling
gap> PermList(1);
Expand Down

0 comments on commit 7b14c09

Please sign in to comment.