Skip to content

Commit 7a8f51d

Browse files
committed
Remove *.ormolu.unchanged formatting tests
1 parent f51d4e8 commit 7a8f51d

File tree

3 files changed

+10
-32
lines changed

3 files changed

+10
-32
lines changed

test/functional/Format.hs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -144,23 +144,17 @@ brittanyTests = testGroup "brittany" [
144144

145145
ormoluTests :: TestTree
146146
ormoluTests = testGroup "ormolu"
147-
[ goldenVsStringDiff "formats correctly" goldenGitDiff ("test/testdata/Format.ormolu." ++ ormoluGoldenSuffix ++ ".hs") $ runSession hieCommand fullCaps "test/testdata" $ do
148-
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfig "ormolu"))
149-
doc <- openDoc "Format.hs" "haskell"
150-
formatDoc doc (FormattingOptions 2 True)
151-
BS.fromStrict . T.encodeUtf8 <$> documentContents doc
152-
, goldenVsStringDiff "sorts imports correctly" goldenGitDiff ("test/testdata/Format2.ormolu." ++ ormoluGoldenSuffix ++ ".hs") $ runSession hieCommand fullCaps "test/testdata" $ do
153-
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfig "ormolu"))
154-
doc <- openDoc "Format2.hs" "haskell"
155-
formatDoc doc (FormattingOptions 2 True)
156-
BS.fromStrict . T.encodeUtf8 <$> documentContents doc
147+
[ goldenVsStringDiff "formats correctly" goldenGitDiff "test/testdata/Format.ormolu.formatted.hs" $ runSession hieCommand fullCaps "test/testdata" $ do
148+
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfig "ormolu"))
149+
doc <- openDoc "Format.hs" "haskell"
150+
formatDoc doc (FormattingOptions 2 True)
151+
BS.fromStrict . T.encodeUtf8 <$> documentContents doc
152+
, goldenVsStringDiff "formats imports correctly" goldenGitDiff "test/testdata/Format2.ormolu.formatted.hs" $ runSession hieCommand fullCaps "test/testdata" $ do
153+
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfig "ormolu"))
154+
doc <- openDoc "Format2.hs" "haskell"
155+
formatDoc doc (FormattingOptions 2 True)
156+
BS.fromStrict . T.encodeUtf8 <$> documentContents doc
157157
]
158-
where
159-
ormoluGoldenSuffix = case ghcVersion of
160-
GHC88 -> "formatted"
161-
GHC86 -> "formatted"
162-
_ -> "unchanged"
163-
164158

165159
formatLspConfig :: Value -> Value
166160
formatLspConfig provider = object [ "haskell" .= object ["formattingProvider" .= (provider :: Value)] ]

test/testdata/Format.ormolu.unchanged.hs

Lines changed: 0 additions & 11 deletions
This file was deleted.

test/testdata/Format2.ormolu.unchanged.hs

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)