Skip to content

Commit dd74b75

Browse files
committed
Eval plugin test fixups
1 parent 1e0e1b8 commit dd74b75

File tree

4 files changed

+26
-5
lines changed

4 files changed

+26
-5
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ tests =
131131
, goldenWithEvalAndFs "Transitive local dependency" (FS.directProjectMulti ["TTransitive.hs", "TLocalImport.hs", "Util.hs"]) "TTransitive" "hs"
132132
-- , goldenWithEval "Local Modules can be imported in a test" "TLocalImportInTest" "hs"
133133
, goldenWithEval "Setting language option TupleSections" "TLanguageOptionsTupleSections" "hs"
134-
, goldenWithEval' ":set accepts ghci flags" "TFlags" "hs" (if ghcVersion >= GHC92 then "ghc98.expected" else if ghcVersion >= GHC92 then "ghc92.expected" else "expected")
134+
, goldenWithEval' ":set accepts ghci flags" "TFlags" "hs" (if ghcVersion >= GHC98 then "ghc98.expected" else if ghcVersion >= GHC92 then "ghc92.expected" else "expected")
135135
, testCase ":set -fprint-explicit-foralls works" $ do
136136
evalInFile "T8.hs" "-- >>> :t id" "-- id :: a -> a"
137137
evalInFile "T8.hs" "-- >>> :set -fprint-explicit-foralls\n-- >>> :t id"
@@ -142,7 +142,9 @@ tests =
142142
, goldenWithEval "IO expressions are supported, stdout/stderr output is ignored" "TIO" "hs"
143143
, goldenWithEvalAndFs "Property checking" cabalProjectFS "TProperty" "hs"
144144
, goldenWithEvalAndFs' "Property checking with exception" cabalProjectFS "TPropertyError" "hs" (
145-
if ghcVersion >= GHC96 then
145+
if ghcVersion >= GHC98 then
146+
"ghc98.expected"
147+
else if ghcVersion >= GHC96 then
146148
"ghc96.expected"
147149
else if ghcVersion >= GHC94 && hostOS == Windows then
148150
"windows-ghc94.expected"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{-# LANGUAGE TypeApplications #-}
2+
module T14 where
3+
4+
foo :: Show a => a -> String
5+
foo = show
6+
7+
-- >>> :type foo @Int
8+
-- foo @Int :: Show Int => Int -> String

plugins/hls-eval-plugin/test/testdata/TFlags.ghc98.expected.hs

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Options apply only in the section where they are defined (unless they are in the
2121
2222
>>> class L a b c
2323
Too many parameters for class `L'
24-
(Enable MultiParamTypeClasses to allow multi-parameter classes)
2524
In the class declaration for `L'
2625
-}
2726

@@ -33,7 +32,6 @@ Not set yet:
3332
3433
>>> class D
3534
No parameters for class `D'
36-
(Enable MultiParamTypeClasses to allow no-parameter classes)
3735
In the class declaration for `D'
3836
3937
Now it works:
@@ -57,7 +55,7 @@ It still works
5755
{- Invalid option/flags are reported, but valid ones will be reflected
5856
5957
>>> :set -XRank2Types -XAbsent -XDatatypeContexts -XWrong -fprint-nothing-at-all
60-
<interactive>: warning:
58+
<interactive>: warning: [GHC-53692] [-Wdeprecated-flags (in -Wdefault)]
6159
-XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
6260
Some flags have not been recognized: -XAbsent, -XWrong, -fprint-nothing-at-all
6361
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- Support for property checking
2+
module TProperty where
3+
4+
-- prop> \(l::[Bool]) -> head l
5+
-- *** Failed! (after 1 test):
6+
-- Exception:
7+
-- Prelude.head: empty list
8+
-- CallStack (from HasCallStack):
9+
-- error, called at libraries/base/GHC/List.hs:1782:3 in base:GHC.List
10+
-- errorEmptyList, called at libraries/base/GHC/List.hs:89:11 in base:GHC.List
11+
-- badHead, called at libraries/base/GHC/List.hs:83:28 in base:GHC.List
12+
-- head, called at <interactive>:1:27 in interactive:Ghci2
13+
-- []

0 commit comments

Comments
 (0)