mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-12-26 11:13:39 +03:00
16 lines
307 B
Elm
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
|