Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tests for monoid output for orientation preserving and reversing monoids #108

Open
wants to merge 1 commit into
base: libsemigroups-v3
Choose a base branch
from

Conversation

MTWhyte
Copy link
Contributor

@MTWhyte MTWhyte commented Jan 24, 2023

This PR updates the tests for orientation_preserving_monoid and orientation_reversing_monoid to work with monoid presentation output, rather than semigroup presentation.

@MTWhyte
Copy link
Contributor Author

MTWhyte commented Jan 24, 2023

The CI tanked, but we expected this, right?

@james-d-mitchell
Copy link
Member

Thanks @MTWhyte, yes I think I'd expect the CI to tank. Perhaps the test can be made more robust using something similar to:

if (
compare_version_numbers(libsemigroups_version(), "2.5.2")
or p.letter(0) == "a"
):
assert p.letter(0) == "a"
assert p.letter(1) == "b"
assert p.letter(2) == "c"
else:
assert p.letter(0) == "\x00"
assert p.letter(1) == "\x01"
assert p.letter(2) == "\x02"

This way we can merge and everything will be ok!

@james-d-mitchell james-d-mitchell added the tests A label for PRs or issues related to the tests label Feb 3, 2023
@MTWhyte
Copy link
Contributor Author

MTWhyte commented Feb 15, 2023

Thanks @MTWhyte, yes I think I'd expect the CI to tank. Perhaps the test can be made more robust using something similar to:

if (
compare_version_numbers(libsemigroups_version(), "2.5.2")
or p.letter(0) == "a"
):
assert p.letter(0) == "a"
assert p.letter(1) == "b"
assert p.letter(2) == "c"
else:
assert p.letter(0) == "\x00"
assert p.letter(1) == "\x01"
assert p.letter(2) == "\x02"

This way we can merge and everything will be ok!

I think we touched on this the other day, I understand presentation.make gives a string presentation, whereas fpsemigroup.make gives a word-type presentation. Just to check: since I'm using the latter here, should this test be independent of the version? Or am I mistaken and in fact make from both namespaces will use strings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests A label for PRs or issues related to the tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants