Closed timbray closed 2 months ago
Looks like this is tied to matchesValue
being a Set. https://github.com/aws/event-ruler/blob/96bb056848cbb3e98023244543d23a1557137653/src/test/software/amazon/event/ruler/ByteMachineTest.java#L2693.
So it works because of the order of writes to that map. Not a real problem then; but probably best to remove "hello"
from the noMatches
list in some future PR.
Yup. I'm looking for more such cases, e.g. testWildcardSecondLastCharWildcardOccursBeforeDivergentFinalCharacterOfExactMatch
and helo
. Will send a PR after that.
Of course, I was copying Ruler unit tests for Quamina and I couldn't get this one to pass. Had me seriously baffled for a few minutes.
It looks like the tests were copied from other tests and fixed for any failures. Given the number of tests Shawn added, totally can see how few edge cases were missed.
Hopefully the new fix is enough to flag the missing cases. I couldn’t find anything else that would be worth changing/adding yet but I’ll follow along Quamina’s changes to see if there’s more I can add to ruler.
Thanks for pointing this out @timbray
It's possible that I just don't understand how
testPatternPermutations()
works, because it's a complex tangle of stream idioms that I happily forgot the instant I was no longer doing Java every day.But the string
"hello"
appears in both the list of strings that should match the wildcard"*hello"
and thenoMatches
list of strings that (if I read the code correctly) shouldn't match the machine after all the patterns have been added.