summaryrefslogtreecommitdiffstats
path: root/tst
diff options
context:
space:
mode:
Diffstat (limited to 'tst')
-rw-r--r--tst/test01.tst31
-rw-r--r--tst/testall.g10
2 files changed, 41 insertions, 0 deletions
diff --git a/tst/test01.tst b/tst/test01.tst
new file mode 100644
index 0000000..56cf0a8
--- /dev/null
+++ b/tst/test01.tst
@@ -0,0 +1,31 @@
+gap> TestRandom := function(n)
+> local
+> p,
+> g,
+> l,
+> i;
+> p := RandomPartialPerm(n);
+> p := ComponentsOfPartialPerm(p);
+> g := YoungGroupFromPartition(p);
+> l := SubgroupLadder(g);
+> for i in [2..Length(l)] do
+> if Order(l[i]) < Order(l[i-1]) then
+> if not (IsSubgroup(l[i-1],l[i]) and Index(l[i-1],l[i]) <= n) then
+> return false;
+> fi;
+> else
+> if not (IsSubgroup(l[i],l[i-1]) and Index(l[i],l[i-1]) <= n) then
+> return false;
+> fi;
+> fi;
+> od;
+> return true;
+> end;;
+
+#
+gap> TestRandom(20);
+true
+gap> TestRandom(30);
+true
+gap> TestRandom(40);
+true
diff --git a/tst/testall.g b/tst/testall.g
new file mode 100644
index 0000000..7a8c927
--- /dev/null
+++ b/tst/testall.g
@@ -0,0 +1,10 @@
+#
+# subgroupladders: This package provides an algorithm that computes a subgroup ladder from a permutation group up to the parent symmetric group.
+#
+# This file runs package tests. It is also referenced in the package
+# metadata in PackageInfo.g.
+#
+LoadPackage( "subgroupladders" );
+
+TestDirectory(DirectoriesPackageLibrary( "subgroupladders", "tst" ), rec(exitGAP := true));
+FORCE_QUIT_GAP(1);