@@ -12,8 +12,7 @@ import Test.Tasty
1212import Test.Tasty.Golden
1313import Test.Tasty.HUnit
1414
15- #if MIN_VERSION_GLASGOW_HASKELL(8,10,0,0) || !defined(AGPL)
16- #else
15+ #if AGPL
1716import qualified Data.Text.IO as T
1817#endif
1918
@@ -30,9 +29,7 @@ tests = testGroup "format document" [
3029 , rangeTests
3130 , providerTests
3231 , stylishHaskellTests
33- -- There's no Brittany formatter on the 8.10.1 builds (yet)
34- #if MIN_VERSION_GLASGOW_HASKELL(8,10,0,0) || !defined(AGPL)
35- #else
32+ #if AGPL
3633 , brittanyTests
3734#endif
3835 , ormoluTests
@@ -63,9 +60,7 @@ providerTests = testGroup "formatting provider" [
6360 formatRange doc (FormattingOptions 2 True ) (Range (Position 1 0 ) (Position 3 10 ))
6461 documentContents doc >>= liftIO . (@?= orig)
6562
66- -- There's no Brittany formatter on the 8.10.1 builds (yet)
67- #if MIN_VERSION_GLASGOW_HASKELL(8,10,0,0) || !defined(AGPL)
68- #else
63+ #if AGPL
6964 , testCase " can change on the fly" $ runSession hieCommand fullCaps " test/testdata" $ do
7065 formattedBrittany <- liftIO $ T. readFile " test/testdata/Format.brittany.formatted.hs"
7166 formattedFloskell <- liftIO $ T. readFile " test/testdata/Format.floskell.formatted.hs"
@@ -114,8 +109,7 @@ stylishHaskellTests = testGroup "stylish-haskell" [
114109 BS. fromStrict . T. encodeUtf8 <$> documentContents doc
115110 ]
116111
117- #if MIN_VERSION_GLASGOW_HASKELL(8,10,0,0) || !defined(AGPL)
118- #else
112+ #if AGPL
119113brittanyTests :: TestTree
120114brittanyTests = testGroup " brittany" [
121115 goldenVsStringDiff " formats a document with LF endings" goldenGitDiff " test/testdata/BrittanyLF.formatted_document.hs" $ runSession hieCommand fullCaps " test/testdata" $ do
@@ -177,8 +171,7 @@ fourmoluTests = testGroup "fourmolu"
177171formatLspConfig :: Value -> Value
178172formatLspConfig provider = object [ " haskell" .= object [" formattingProvider" .= (provider :: Value )] ]
179173
180- #if MIN_VERSION_GLASGOW_HASKELL(8,10,0,0) || !defined(AGPL)
181- #else
174+ #if AGPL
182175-- | The same as 'formatLspConfig' but using the legacy section name
183176formatLspConfigOld :: Value -> Value
184177formatLspConfigOld provider = object [ " languageServerHaskell" .= object [" formattingProvider" .= (provider :: Value )] ]
0 commit comments