This repository was archived by the owner on Oct 7, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -95,9 +95,13 @@ spec = do
95
95
-- Work in progress
96
96
describe " ormolu" $ do
97
97
it " formats correctly" $ runSession hieCommand fullCaps " test/testdata" $ do
98
+ sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfig " ormolu" ))
98
99
doc <- openDoc " Format.hs" " haskell"
99
100
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
101
105
102
106
103
107
formattedDocTabSize2 :: T. Text
@@ -185,3 +189,15 @@ formattedOrmolu =
185
189
\bar s = do\n \
186
190
\ x <- return \" hello\"\n \
187
191
\ 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 "
You can’t perform that action at this time.
0 commit comments