Add tests for import sorting
parent
f67e72e82c
commit
9efed95d50
|
@ -1294,6 +1294,29 @@ import qualified Data.List as L
|
||||||
-- Test
|
-- Test
|
||||||
import Test ( 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
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
|
@ -159,6 +159,10 @@ main = do
|
||||||
(Parsec.noneOf "\r\n")
|
(Parsec.noneOf "\r\n")
|
||||||
, _ <- Parsec.eof
|
, _ <- Parsec.eof
|
||||||
]
|
]
|
||||||
|
, [ NormalLine mempty
|
||||||
|
| _ <- Parsec.try $ Parsec.string "<BLANKLINE>"
|
||||||
|
, _ <- Parsec.eof
|
||||||
|
]
|
||||||
]
|
]
|
||||||
lineMapper :: Text -> InputLine
|
lineMapper :: Text -> InputLine
|
||||||
lineMapper line = case Parsec.runParser specialLineParser () "" line of
|
lineMapper line = case Parsec.runParser specialLineParser () "" line of
|
||||||
|
|
Loading…
Reference in New Issue