Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 1f6b1fc

Browse files
committed
Completing formatting test
1 parent c1c40b4 commit 1f6b1fc

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

test/functional/FormatSpec.hs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,13 @@ spec = do
9595
-- Work in progress
9696
describe "ormolu" $ do
9797
it "formats correctly" $ runSession hieCommand fullCaps "test/testdata" $ do
98+
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfig "ormolu"))
9899
doc <- openDoc "Format.hs" "haskell"
99100
formatDoc doc (FormattingOptions 2 True)
100-
documentContents doc >>= liftIO . (`shouldBe` formattedOrmolu)
101+
docContent <- documentContents doc
102+
case ghcVersion of
103+
GHC86 -> liftIO $ docContent `shouldBe` formattedOrmolu
104+
_ -> liftIO $ docContent `shouldBe` unchangedOrmolu
101105

102106

103107
formattedDocTabSize2 :: T.Text
@@ -185,3 +189,15 @@ formattedOrmolu =
185189
\bar s = do\n\
186190
\ x <- return \"hello\"\n\
187191
\ return \"asdf\"\n"
192+
193+
unchangedOrmolu :: T.Text
194+
unchangedOrmolu =
195+
"module Format where\n\
196+
\foo :: Int -> Int\n\
197+
\foo 3 = 2\n\
198+
\foo x = x\n\
199+
\bar :: String -> IO String\n\
200+
\bar s = do\n\
201+
\ x <- return \"hello\"\n\
202+
\ return \"asdf\"\n\
203+
\ \n"

0 commit comments

Comments
 (0)