Add tests for Roman numeral regex validation#458
Add tests for Roman numeral regex validation#458moritz-gross wants to merge 5 commits intodaisy:mainfrom
Conversation
NSoiffer
left a comment
There was a problem hiding this comment.
When they get used, they have been trimmed. If they appear in some text string, which might include a space, then they shouldn't match.
I thought some braille codes I started with did something special for roman numerals, but they didn't so I think that is what the comment is about. However, I see at least Finnish braille cares. Looking at the code, I see several places where intended roman numerals get cleaned up (three variables V I I which should be a single token VII). Also, they are used in chemistry.
|
ok sounds good, do we still want to add this test case, also as a way to document the expected behaviour? |
|
There are higher level tests "roman_numeral" and "not_roman_numeral", so I'm not sure these are needed. It doesn't hurt have more tests. However, they do need to be adjusted. |
|
let's work on other things for now |
while working with
LazyLock, I saw thatUPPER_ROMAN_NUMERALandLOWER_ROMAN_NUMERALhave two matching operators^at the start, making them not match leading whitespace. Is that the correct behaviour?The comment in the code sounds like they aren't really needed generally though.
in the added test cases, the ones with leading whitespace are failing (
cargo test test_roman_numeral_regex)