I think if we are testing for absolute correctness of the match, then this should be an anchored pattern and use "^...$". Currently, this grok_match would pass: grok_match("WORD", "fancy pants") and while it's correct that it matches, it feels like the grok_match method is intended to be an exact match, where the prior example would match successfully but only matching fancy. This would make it hard to do failure-expectations, that grok_match("WORD", "fancy pants") should actually fail, because there are two words and WORD should not match that fully.
The current code executes this:
I think if we are testing for absolute correctness of the match, then this should be an anchored pattern and use "^...$". Currently, this grok_match would pass:
grok_match("WORD", "fancy pants")
and while it's correct that it matches, it feels like thegrok_match
method is intended to be an exact match, where the prior example would match successfully but only matchingfancy
. This would make it hard to do failure-expectations, thatgrok_match("WORD", "fancy pants")
should actually fail, because there are two words and WORD should not match that fully.