Skip to content

Commit 3f40d60

Browse files
committed
Don't use CPP in refactor plugin tests
1 parent 5ed34ed commit 3f40d60

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

plugins/hls-refactor-plugin/hls-refactor-plugin.cabal

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ test-suite tests
110110
, hls-test-utils == 2.6.0.0
111111
, lens
112112
, lsp-types
113-
-- for MIN_VERSION_ghc
114-
, ghc
115113
, text
116114
, hls-plugin-api
117115
, parser-combinators

plugins/hls-refactor-plugin/test/Main.hs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE AllowAmbiguousTypes #-}
2-
{-# LANGUAGE CPP #-}
32
{-# LANGUAGE DataKinds #-}
43
{-# LANGUAGE DuplicateRecordFields #-}
54
{-# LANGUAGE GADTs #-}
@@ -701,11 +700,9 @@ typeWildCardActionTests = testGroup "type wildcard actions"
701700
[ "func :: _"
702701
, "func x y = x + y"
703702
]
704-
#if MIN_VERSION_ghc(9,7,0)
705-
[ "func :: a -> a -> a" -- 9.8 has a different suggestion
706-
#else
707-
[ "func :: Integer -> Integer -> Integer"
708-
#endif
703+
[ if ghcVersion >= GHC98
704+
then "func :: a -> a -> a" -- 9.8 has a different suggestion
705+
else "func :: Integer -> Integer -> Integer"
709706
, "func x y = x + y"
710707
]
711708
, testUseTypeSignature "type in parentheses"
@@ -733,11 +730,9 @@ typeWildCardActionTests = testGroup "type wildcard actions"
733730
[ "func::_"
734731
, "func x y = x + y"
735732
]
736-
#if MIN_VERSION_ghc(9,7,0)
737-
[ "func::a -> a -> a" -- 9.8 has a different suggestion
738-
#else
739-
[ "func::Integer -> Integer -> Integer"
740-
#endif
733+
[ if ghcVersion >= GHC98
734+
then "func::a -> a -> a" -- 9.8 has a different suggestion
735+
else "func::Integer -> Integer -> Integer"
741736
, "func x y = x + y"
742737
]
743738
, testGroup "add parens if hole is part of bigger type"

0 commit comments

Comments
 (0)