You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mkResult in Runner.Example is the heart of doctest: it checks the actual output against the expected pattern, which can include wildcards both within a line and across lines.
Here's how wildcard matching is implemented currently:
Note that they'll try both branches in isolation, leading to an exponential running time on pathological input. This has been made slightly worse by #249 wanting to go down both branches to find the best place to show the difference, but it was there before.
In most cases this is pretty un-noticeable to users, who'll tend to use tame patterns, but it's currently biting me in running the test suite where QuickCheck generates some real monsters.
Since the patterns are a regular language, mkResult could be re-implemented to use finite automata instead, which should bring a significant speed-up on pathological input.
The text was updated successfully, but these errors were encountered:
mkResult
inRunner.Example
is the heart ofdoctest
: it checks the actual output against the expected pattern, which can include wildcards both within a line and across lines.Here's how wildcard matching is implemented currently:
doctest/src/Runner/Example.hs
Lines 51 to 55 in 24bb7f5
and
doctest/src/Runner/Example.hs
Lines 69 to 72 in 24bb7f5
Note that they'll try both branches in isolation, leading to an exponential running time on pathological input. This has been made slightly worse by #249 wanting to go down both branches to find the best place to show the difference, but it was there before.
In most cases this is pretty un-noticeable to users, who'll tend to use tame patterns, but it's currently biting me in running the test suite where QuickCheck generates some real monsters.
Since the patterns are a regular language,
mkResult
could be re-implemented to use finite automata instead, which should bring a significant speed-up on pathological input.The text was updated successfully, but these errors were encountered: