Skip to content

Commit 3edfaeb

Browse files
committed
Fix func-test for ormolu
1 parent 23196e2 commit 3edfaeb

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/functional/FormatSpec.hs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import TestUtils
1111

1212
spec :: Spec
1313
spec = do
14+
let formatLspConfig provider =
15+
object [ "languageServerHaskell" .= object ["formattingProvider" .= (provider :: Value)] ]
16+
formatConfig provider = defaultConfig { lspConfig = Just (formatLspConfig provider) }
1417
describe "format document" $ do
1518
it "works" $ runSession hieCommand fullCaps "test/testdata" $ do
1619
doc <- openDoc "Format.hs" "haskell"
@@ -36,10 +39,6 @@ spec = do
3639
-- documentContents doc >>= liftIO . (`shouldBe` formattedRangeTabSize5)
3740

3841
describe "formatting provider" $ do
39-
let formatLspConfig provider =
40-
object [ "languageServerHaskell" .= object ["formattingProvider" .= (provider :: Value)] ]
41-
formatConfig provider = defaultConfig { lspConfig = Just (formatLspConfig provider) }
42-
4342
it "respects none" $ runSessionWithConfig (formatConfig "none") hieCommand fullCaps "test/testdata" $ do
4443
doc <- openDoc "Format.hs" "haskell"
4544
orig <- documentContents doc
@@ -177,7 +176,7 @@ formattedDocTabSize5 =
177176
formattedRangeTabSize2 :: T.Text
178177
formattedRangeTabSize2 =
179178
"{-# LANGUAGE NoImplicitPrelude #-}\n\
180-
\module Format where\n\
179+
\module Format where\n\n\
181180
\foo :: Int -> Int\n\
182181
\foo 3 = 2\n\
183182
\foo x = x\n\

0 commit comments

Comments
 (0)