Skip to content

Commit

Permalink
Cleanup in tst (#5571)
Browse files Browse the repository at this point in the history
* Rename tst/testutil.g -> tst/delegation.g

Also remove an outdated (now incorrect) comment referencing that file;
and remove an old bugfix test accessing it: it is not clear what that
bugfix was supposed to test: it used to invoke just `ReadGapRoot` but
was rewritten to call `IsReadableFile`+`Filename`+`DirectoriesLibrary`;
but it is not clear what either is supposed to test, exactly.

* tst: move two files into tst/testinstall/

Those files are only used by `testinstall` so it makes sense to move them
in there. But primarily, it gets us closer to having all files with a
name of the form `tst/test*.g` serving the same purpose, namely to run a
testsuite with corresponding name.

* tst: unify some permutation constructor tests

Properly test bounds checks in the kernel for creating permutations:
one of the errors can only ever be reached in 64 bit mode; the other
however can always be reached, and thus should always be tested.

Note that the tst/test32bit and tst/test64bit directories were supposed
to be removed in 2018 (!) and files in there were in fact not loaded
since then (!!). My guess is that a file in each remained because of PRs
being merged "out of order" so that the PR which was supposed to remove
those dirs was merged only after some other PR added new files.

But we actually tested the constructors as part of the `RestrictedPerm`
tests, but it really wasn't appropriate there (the tests didn't even
reach `RestrictedPerm` as the kernel errors occur before the call).
  • Loading branch information
fingolfin committed Jan 10, 2024
1 parent b30a71a commit a698f21
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 28 deletions.
3 changes: 0 additions & 3 deletions lib/profile.g
Original file line number Diff line number Diff line change
Expand Up @@ -1068,9 +1068,6 @@ end);
## <Log><![CDATA[
## gap> STOP_TEST( "same identifier string as for START_TEST" );
## ]]></Log>
## <P/>
## Note that the functions in <F>tst/testutil.g</F> temporarily replace
## <Ref Func="STOP_TEST"/> before they call <Ref Func="Test"/>.
## </Description>
## </ManSection>
## <#/GAPDoc>
Expand Down
3 changes: 0 additions & 3 deletions tst/testutil.g → tst/delegation.g
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
##
## SPDX-License-Identifier: GPL-2.0-or-later
##
## This file contains utilities for running tests.
## It is not read with the library when {\GAP} is started.
##


#############################################################################
Expand Down
5 changes: 0 additions & 5 deletions tst/test32bit/perm.tst

This file was deleted.

4 changes: 0 additions & 4 deletions tst/test64bit/perm.tst

This file was deleted.

3 changes: 0 additions & 3 deletions tst/testbugfix/2005-05-05-t00072.tst

This file was deleted.

2 changes: 1 addition & 1 deletion tst/testinstall/coll.tst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
##
gap> START_TEST("coll.tst");
gap> if not IsBound(TestConsistencyOfEnumeratorByFunctions) then
> ReadGapRoot( "tst/testenumerator.g" );
> ReadGapRoot( "tst/testinstall/testenumerator.g" );
> fi;

#
Expand Down
7 changes: 7 additions & 0 deletions tst/testinstall/perm.tst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ gap> (1,2)(1,2);
Error, Permutation: cycles must be disjoint and duplicate-free
gap> (1,2,3,2);
Error, Permutation: cycles must be disjoint and duplicate-free
gap> (1,2^80);
Error, Permutation: <expr> must be a positive small integer (not a large posit\
ive integer)
#@if 8*GAPInfo.BytesPerVariable = 64
gap> (1,2^40);
Error, Permutation literal exceeds maximum permutation degree
#@fi

# The GAP kernel implements many functions in multiple variants, e.g. to
# compare permutations for equality, there are actually four functions in the
Expand Down
2 changes: 1 addition & 1 deletion tst/testinstall/random.tst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#@local R,a,rm,g,orbs,orb,i,getOneInt
gap> START_TEST("random.tst");
gap> ReadGapRoot( "tst/testrandom.g" );
gap> ReadGapRoot( "tst/testinstall/testrandom.g" );

# Test RandomList
gap> randomTest([1,2,3], RandomList);
Expand Down
8 changes: 0 additions & 8 deletions tst/testinstall/restrictedperm.tst
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ Error, <g> must be a permutation and <D> a plain list or range,
gap> RestrictedPerm((),[ 1, 0 ]);
Error, <g> must be a permutation and <D> a plain list or range,
consisting of a union of cycles of <g>
#@if 8*GAPInfo.BytesPerVariable = 64
gap> RestrictedPerm((1,2^40),[ 1, () ]);
Error, Permutation literal exceeds maximum permutation degree
#@else
gap> RestrictedPerm((1,2^40),[ 1, () ]);
Error, Permutation: <expr> must be a positive small integer (not a large posit\
ive integer)
#@fi
gap> RestrictedPerm((1,2^17),[ 1, () ]);
Error, <g> must be a permutation and <D> a plain list or range,
consisting of a union of cycles of <g>
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit a698f21

Please sign in to comment.