@@ -12,8 +12,7 @@ import Test.Tasty
12
12
import Test.Tasty.Golden
13
13
import Test.Tasty.HUnit
14
14
15
- #if MIN_VERSION_GLASGOW_HASKELL(8,10,0,0) || !defined(AGPL)
16
- #else
15
+ #if AGPL
17
16
import qualified Data.Text.IO as T
18
17
#endif
19
18
@@ -30,9 +29,7 @@ tests = testGroup "format document" [
30
29
, rangeTests
31
30
, providerTests
32
31
, 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
36
33
, brittanyTests
37
34
#endif
38
35
, ormoluTests
@@ -63,9 +60,7 @@ providerTests = testGroup "formatting provider" [
63
60
formatRange doc (FormattingOptions 2 True ) (Range (Position 1 0 ) (Position 3 10 ))
64
61
documentContents doc >>= liftIO . (@?= orig)
65
62
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
69
64
, testCase " can change on the fly" $ runSession hieCommand fullCaps " test/testdata" $ do
70
65
formattedBrittany <- liftIO $ T. readFile " test/testdata/Format.brittany.formatted.hs"
71
66
formattedFloskell <- liftIO $ T. readFile " test/testdata/Format.floskell.formatted.hs"
@@ -114,8 +109,7 @@ stylishHaskellTests = testGroup "stylish-haskell" [
114
109
BS. fromStrict . T. encodeUtf8 <$> documentContents doc
115
110
]
116
111
117
- #if MIN_VERSION_GLASGOW_HASKELL(8,10,0,0) || !defined(AGPL)
118
- #else
112
+ #if AGPL
119
113
brittanyTests :: TestTree
120
114
brittanyTests = testGroup " brittany" [
121
115
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"
177
171
formatLspConfig :: Value -> Value
178
172
formatLspConfig provider = object [ " haskell" .= object [" formattingProvider" .= (provider :: Value )] ]
179
173
180
- #if MIN_VERSION_GLASGOW_HASKELL(8,10,0,0) || !defined(AGPL)
181
- #else
174
+ #if AGPL
182
175
-- | The same as 'formatLspConfig' but using the legacy section name
183
176
formatLspConfigOld :: Value -> Value
184
177
formatLspConfigOld provider = object [ " languageServerHaskell" .= object [" formattingProvider" .= (provider :: Value )] ]
0 commit comments