moodmosaic / Fare

Port of Java dk.brics.automaton and xeger, mostly used for generating strings that match a specific regular expression.
http://www.brics.dk/automaton/
MIT License
183 stars 43 forks source link

Remove ^ and $ markers at the beginning #35

Closed zvirja closed 6 years ago

zvirja commented 6 years ago

The current approach when characters are removed from the result suffers from the issue that sometimes symbols are the valid parts of result. Therefore, after we remove them, the produced string no longer matches the expected regular expression.

Fixed that by removing markers before regular expression generation.

moodmosaic commented 6 years ago

Interesting! :)

Do you have any test cases in mind that we could add to the test suite?

zvirja commented 6 years ago

Actually, this bug fails the existing tests. If you run tests for multiple times, sometimes some of them will fail. After I applied this change, tests stopped to fail (actually, they are still flucky, but due to the different reason :sweat_smile:).

Do you want me to add test cases which previously failed for each time? ;-)

moodmosaic commented 6 years ago

Do you want me to add test cases which previously failed for each time? ;-)

That'd be awesome :+1:

zvirja commented 6 years ago

Added ;-)