Skip to content

Commit

Permalink
Add failing test cases for post qualified import formatting.
Browse files Browse the repository at this point in the history
  
Related to haskell#284 and haskell#334
  • Loading branch information
akrmn committed Jul 12, 2021
1 parent c5c7b50 commit ad0cebe
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tests/Language/Haskell/Stylish/Step/Imports/Tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ tests = testGroup "Language.Haskell.Stylish.Step.Imports.Tests"
, testCase "case 31" case31
, testCase "case 32" case32
, testCase "case 33" case33
, testCase "case 34" case34
, testCase "case 35" case35
, testCase "case 36" case36
, testCase "case 37" case37
]


Expand Down Expand Up @@ -885,3 +889,37 @@ case33 = assertSnippet (step Nothing defaultOptions {postQualified = True})
, "import Data.Foo (Foo (Bar, Foo), Goo (Goo))"
, "import Data.Set (empty, intersect, nub)"
]

--------------------------------------------------------------------------------
case34 :: Assertion
case34 = assertSnippet (step Nothing defaultOptions {postQualified = True})
[ "import qualified Data.Aeson as JSON (Value)"
]
[ "import Data.Aeson qualified as JSON (Value)"
]

--------------------------------------------------------------------------------
case35 :: Assertion
case35 = assertSnippet (step Nothing defaultOptions {postQualified = True})
[ "import Data.Aeson qualified as JSON (Value)"
]
[ "import Data.Aeson qualified as JSON (Value)"
]

--------------------------------------------------------------------------------
case36 :: Assertion
case36 = assertSnippet (step Nothing defaultOptions {postQualified = True})
[ "import qualified Data.Aeson as JSON (Value)"
, "import qualified Data.Aeson as JSON (encode, decode)"
]
[ "import Data.Aeson qualified as JSON (Value, decode, encode)"
]

--------------------------------------------------------------------------------
case37 :: Assertion
case37 = assertSnippet (step Nothing defaultOptions {postQualified = True})
[ "import Data.Aeson qualified as JSON (Value)"
, "import Data.Aeson qualified as JSON (encode, decode)"
]
[ "import Data.Aeson qualified as JSON (Value, decode, encode)"
]

0 comments on commit ad0cebe

Please sign in to comment.