elm-review/tests/TestUtil.elm
2017-06-13 01:31:10 +02:00

16 lines
307 B
Elm

module TestUtil exposing (ruleTester)
import Regex
import Lint.Types exposing (LintRule, Error)
spacesRegex : Regex.Regex
spacesRegex =
Regex.regex "\n "
ruleTester : (LintRule) -> LintRule
ruleTester rule str =
Regex.replace Regex.All spacesRegex (\_ -> "\n") str
|> rule