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

move Operations.sameLanguage/subsetOf to AutomatonTestUtil in test-framework #13708

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

rmuir
Copy link
Member

@rmuir rmuir commented Sep 2, 2024

These methods run in quadratic time and have been traps in the past: they run in quadratic time.

I think originally this was equals() but it is so costly, that we factored out into separate sameLanguage methods.

Additionally methods are a bit smelly, they will throw exception if the inputs aren't deterministic, and they'll only assert if there are transitions to dead states... they are really only suitable for tests code.

We've been making progress moving some of this code to test framework, this is just the next iteration. Would love to factor out more (dead states checks etc) but that's more difficult.

Copy link
Member

@mikemccand mikemccand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rmuir.

@@ -35,9 +35,14 @@
* @lucene.experimental
*/
public class StatePair {
// only mike knows what it does (do not expose)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol.

@rmuir rmuir merged commit 87bc827 into apache:main Sep 5, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants