1. leapfrogdevelopment
  2. rstr
Issue #1 resolved

xeger('.+') Can Produce Strings That Do Not Match '.+'

Kenny Trytek
created an issue

Given rstr.xeger('.+'), sometimes the output has '\n' in it, which is the only character that '.' does not match. It's an intermittent bug, and failed 37% of the time out of 10,000 iterations that I tried it, using the default STAR_PLUS_LIMIT of 100.

>>> failures = 0
>>> for i in range(10000):
...   if '\n' in rstr.xeger('.+'):
...     failures += 1
>>> failures

Workaround: Perform a .replace() on the output, e.g. rstr.xeger('.+').replace('\n', 'nn')