SIGN IN SIGN UP

Protocol Buffers - Google's data interchange format

0 0 180 C++

Fix failure list trie behavior (#19207)

There was no mechanism to recognize test names as prefix of another. Although it seems hard to see where this might occur in practice, this is the way that a trie **should** behave. In other words, this behavior should be here just in case.

The current behavior is that if someone were to insert "Recommended.Proto2.Whatever" and "Recommended.Proto2" to the trie and tried to match "Recommended.Proto2", then it would return false when it should return true. Although this example is not good on a practical sense (why would we ever have a test name like "Recommended.Proto2"...), I can imagine a test name being a derivative of a general case: "Recommended.Proto2.General" and "Recommended.Proto2.General.Specific". Maybe we shouldn't ever have a naming convention like that
; but since there's no standard/enforced naming convention, there's no way to say if we want this behavior or not.

There might be some debate of whether or not to consider these prefixes as duplicates, but I'm not completely sure. We might be able to further enforce naming convention in that "no new test name should be a prefix of another".

Let me know what you  think whoever reviews this!

Closes #19207

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/19207 from yamilmorales:main 01b8baba77a5307dd64bf1eda36005450c3e1001
PiperOrigin-RevId: 702122383
Y
Yamil Morales committed
e1603839a5c54bd85a6f8f5000db9c57a5b60a3c
Parent: c879ccc
Committed by Copybara-Service <copybara-worker@google.com> on 12/3/2024, 12:44:28 AM