mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-11-23 23:05:35 +03:00
16 lines
321 B
Elm
16 lines
321 B
Elm
module TestUtil exposing (ruleTester)
|
|
|
|
import Regex
|
|
import Lint.Types exposing (Error)
|
|
|
|
|
|
spacesRegex : Regex.Regex
|
|
spacesRegex =
|
|
Regex.regex "\n "
|
|
|
|
|
|
ruleTester : (String -> List Error) -> String -> List Error
|
|
ruleTester rule str =
|
|
Regex.replace Regex.All spacesRegex (\_ -> "\n") str
|
|
|> rule
|