tlaplus / CommunityModules

TLA+ snippets, operators, and modules contributed and curated by the TLA+ community
MIT License
273 stars 36 forks source link

Change string replace operators to use StringUtils from apache library #59

Closed afonsonf closed 2 years ago

afonsonf commented 2 years ago

Change how replace is done to use StringUtils from apache library. Add tests for all special characters of TLA+ in strings. Updated some tests because the new library has different behaviour in edge cases: e.g. replace "" with "a" in "" equals "".

Update: Now replace "" with "a" in "" equals "a".

Closes #57

lemmy commented 2 years ago

Does the "edge case" violate the TLA+ def of the operator?

afonsonf commented 2 years ago

Does the "edge case" violate the TLA+ def of the operator?

Yes, however I changed it now to match the TLA+ operator behaviour and reverted the tests

lemmy commented 2 years ago

LGTM (generally I'd suggest adding curly braces even to single-line if statements).

lemmy commented 2 years ago

Are you going to squash and merge to master?