This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36cfdfc
commit fab5793
Showing
2 changed files
with
18 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
class TestFiniteSemigroup(): | ||
class TestFiniteSemigroup: | ||
""" | ||
Tests for finite semigroups. | ||
""" | ||
|
||
@staticmethod | ||
def category_instances(): | ||
from sage.categories.examples.finite_semigroups import LeftRegularBand | ||
|
||
return [ | ||
LeftRegularBand(alphabet = ('a','b')), | ||
LeftRegularBand(alphabet = ('a','b','c')), | ||
LeftRegularBand(alphabet = ('a','b','c', 'd')) | ||
LeftRegularBand(alphabet=("a", "b")), | ||
LeftRegularBand(alphabet=("a", "b", "c")), | ||
LeftRegularBand(alphabet=("a", "b", "c", "d")), | ||
] | ||
|
||
def test_associativity(self, set_elements, max_runs): | ||
""" | ||
Test associativity of multiplication of elements. | ||
""" | ||
from sage.misc.misc import some_tuples | ||
for x, y, z in some_tuples(set_elements, 3, max_runs): | ||
assert (x * y) * z == x * (y * z) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class SemigroupTests: | ||
""" | ||
Generic tests for semigroups. | ||
""" | ||
|
||
def test_associativity(self, set_elements, max_runs): | ||
""" | ||
Test associativity of multiplication of elements. | ||
""" | ||
from sage.misc.misc import some_tuples | ||
|
||
for x, y, z in some_tuples(set_elements, 3, max_runs): | ||
assert (x * y) * z == x * (y * z) |