Add tests for import sorting

pull/325/head
Joe Hermaszewski 2020-11-20 23:03:59 +08:00
parent f67e72e82c
commit 9efed95d50
2 changed files with 27 additions and 0 deletions

View File

@ -1294,6 +1294,29 @@ import qualified Data.List as L
-- Test
import Test ( test )
#test sorted-imports
import Aaa
import Baa
#test sorted-import-groups
import Zaa
import Zab
<BLANKLINE>
import Aaa
import Baa
#test sorted-qualified-imports
import Boo
import qualified Zoo
#test imports-groups-same-module
import Boo ( a )
<BLANKLINE>
import Boo ( b )
#test sorted-imports-nested
import A.B.C
import A.B.D
###############################################################################
###############################################################################

View File

@ -159,6 +159,10 @@ main = do
(Parsec.noneOf "\r\n")
, _ <- Parsec.eof
]
, [ NormalLine mempty
| _ <- Parsec.try $ Parsec.string "<BLANKLINE>"
, _ <- Parsec.eof
]
]
lineMapper :: Text -> InputLine
lineMapper line = case Parsec.runParser specialLineParser () "" line of