Skip to content

Commit

Permalink
Mark expected failures (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
edsko committed Sep 13, 2014
1 parent 0d1a140 commit 51f00ed
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions TestSuite/TestSuite/Assertions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ knownProblems = [
-- errors or just for this particular one (I tried a few but didn't see
-- filepaths in any of them).
("#32", [GHC742])
-- https://github.com/fpco/ide-backend/issues/254
, ("#254", [GHC78])
]

fixme :: IdeSession -> String -> IO () -> IO String
Expand Down
6 changes: 3 additions & 3 deletions TestSuite/TestSuite/Tests/Packages.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ testGroupPackages env = testGroup "Packages" $ [
, stdTest env "Using something from a different package (no \"Loading package\" msg)" test_UseFromDifferentPackage
] ++ docTests env [
stdTest env "Consistency of multiple modules of the same name" test_Consistency
, stdTest env "Consistency of multiple modules of the same name: PackageImports" test_Consistency_PackageImports
, withOK env "Consistency of multiple modules of the same name: PackageImports" test_Consistency_PackageImports
, stdTest env "Module name visible from 2 packages --- picked from monads-tf" test_ModuleIn2Pkgs_1
]

Expand Down Expand Up @@ -254,7 +254,7 @@ test_Consistency env = withAvailableSession env $ \sess -> do
assertIdInfo sess "Bar" (3, 7, 3, 15) "putStrLn" VarName "String -> IO ()" "base-4.5.1.0:System.IO" "<no location info>" "base-4.5.1.0:System.IO" "imported from base-4.5.1.0:Prelude at Bar.hs@1:8-1:11"
-- would fail: assertIdInfo gif "Baz" (6, 8, 6, 9) "foobar" VarName "IO ()" "main:Control.Parallel" "Control/Parallel.hs@7:1-7:7" "" "imported from main:Control/Parallel at Baz.hs@3:1-3:24"

test_Consistency_PackageImports :: TestSuiteEnv -> Assertion
test_Consistency_PackageImports :: TestSuiteEnv -> IO String
test_Consistency_PackageImports env = withAvailableSession env $ \sess -> do
let cb = \_ -> return ()
update = flip (updateSession sess) cb
Expand Down Expand Up @@ -288,7 +288,7 @@ test_Consistency_PackageImports env = withAvailableSession env $ \sess -> do

assertNoErrors sess
assertIdInfo sess "Bar" (3, 7, 3, 15) "putStrLn" VarName "String -> IO ()" "base-4.5.1.0:System.IO" "<no location info>" "base-4.5.1.0:System.IO" "imported from base-4.5.1.0:Prelude at Bar.hs@1:8-1:11"
assertIdInfo sess "Baz" (7, 7, 7, 10) "par" VarName "a1 -> b1 -> b1" "parallel-X.Y.Z:Control.Parallel" "<no location info>" "parallel-X.Y.Z:Control.Parallel" "imported from parallel-X.Y.Z:Control.Parallel at Baz.hs@4:1-4:35"
fixme sess "#254" $ assertIdInfo sess "Baz" (7, 7, 7, 10) "par" VarName "a1 -> b1 -> b1" "parallel-X.Y.Z:Control.Parallel" "<no location info>" "parallel-X.Y.Z:Control.Parallel" "imported from parallel-X.Y.Z:Control.Parallel at Baz.hs@4:1-4:35"

test_ModuleIn2Pkgs_1 :: TestSuiteEnv -> Assertion
test_ModuleIn2Pkgs_1 env = withAvailableSession' env (withGhcOpts packageOpts) $ \session -> do
Expand Down
6 changes: 3 additions & 3 deletions TestSuite/TestSuite/Tests/TypeInformation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ testGroupTypeInformation env = testGroup "Type Information" $ [
, stdTest env "Simple ADTs" testSimpleADTs
, stdTest env "Polymorphism" testPolymorphism
, stdTest env "Multiple modules" testMultipleModules
, stdTest env "External packages, type sigs, scoped type vars, kind sigs" testExternalPkgs
, withOK env "External packages, type sigs, scoped type vars, kind sigs" testExternalPkgs
, stdTest env "Reusing type variables" testReusingTypeVariables
, stdTest env "Qualified imports" testQualifiedImports
, stdTest env "Imprecise source spans" testImpreciseSourceSpans
Expand Down Expand Up @@ -205,13 +205,12 @@ testMultipleModules env = withAvailableSession env $ \session -> do
, "foo = MkT"
])

testExternalPkgs :: TestSuiteEnv -> Assertion
testExternalPkgs :: TestSuiteEnv -> IO String
testExternalPkgs env = withAvailableSession' env (withGhcOpts opts) $ \session -> do
updateSessionD session upd 2
assertNoErrors session
assertIdInfo session "A" (3,1,3,2) "e" VarName "Bool" "main:A" "A.hs@3:1-3:2" "" "binding occurrence"
assertIdInfo session "A" (3,5,3,9) "True" DataName "" "ghc-prim-0.2.0.0:GHC.Types" "<wired into compiler>" "base-4.5.1.0:Data.Bool" "wired in to the compiler"
assertIdInfo session "A" (3,10,3,16) "pseq" VarName "a -> b -> b" "parallel-3.2.0.3:Control.Parallel" "<no location info>" "parallel-3.2.0.3:Control.Parallel" "imported from parallel-3.2.0.3:Control.Parallel at A.hs@2:1-2:24"
assertIdInfo session "A" (3,17,3,22) "False" DataName "" "ghc-prim-0.2.0.0:GHC.Types" "<wired into compiler>" "base-4.5.1.0:Data.Bool" "wired in to the compiler"
assertIdInfo session "A" (4,1,4,2) "f" VarName "a -> a" "main:A" "A.hs@5:1-5:2" "" "defined locally"
assertIdInfo' session "A" (4,6,4,7) (4,6,4,7) "a" TvName [] "main:A" [(GHC742, "A.hs@4:6-4:7"), (GHC78, "A.hs@4:6-4:12")] "" (allVersions "defined locally")
Expand Down Expand Up @@ -249,6 +248,7 @@ testExternalPkgs env = withAvailableSession' env (withGhcOpts opts) $ \session -
assertIdInfo session "A" (14,1,14,2) "i" VarName "t a -> t a" "main:A" "A.hs@14:1-14:2" "" "binding occurrence"
assertIdInfo session "A" (14,3,14,4) "x" VarName "t a" "main:A" "A.hs@14:3-14:4" "" "binding occurrence"
assertIdInfo session "A" (14,7,14,8) "x" VarName "t a" "main:A" "A.hs@14:3-14:4" "" "defined locally"
fixme session "#254" $ assertIdInfo session "A" (3,10,3,16) "pseq" VarName "a -> b -> b" "parallel-3.2.0.3:Control.Parallel" "<no location info>" "parallel-3.2.0.3:Control.Parallel" "imported from parallel-3.2.0.3:Control.Parallel at A.hs@2:1-2:24"
where
opts = [ "-XScopedTypeVariables"
, "-XKindSignatures"
Expand Down

0 comments on commit 51f00ed

Please sign in to comment.