@@ -144,23 +144,17 @@ brittanyTests = testGroup "brittany" [
144
144
145
145
ormoluTests :: TestTree
146
146
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
157
157
]
158
- where
159
- ormoluGoldenSuffix = case ghcVersion of
160
- GHC88 -> " formatted"
161
- GHC86 -> " formatted"
162
- _ -> " unchanged"
163
-
164
158
165
159
formatLspConfig :: Value -> Value
166
160
formatLspConfig provider = object [ " haskell" .= object [" formattingProvider" .= (provider :: Value )] ]
0 commit comments