From 7b14c095434106f539ad79eb8bc470b1b11f4e48 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 3 May 2020 12:34:45 +0200 Subject: [PATCH] Fix PermList for descending ranges --- src/permutat.cc | 2 -- tst/testinstall/perm.tst | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/permutat.cc b/src/permutat.cc index e1de6e5431..8ac58dc578 100644 --- a/src/permutat.cc +++ b/src/permutat.cc @@ -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); } diff --git a/tst/testinstall/perm.tst b/tst/testinstall/perm.tst index 3c3e1bdafe..ab0dfdcf89 100644 --- a/tst/testinstall/perm.tst +++ b/tst/testinstall/perm.tst @@ -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);