-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ba2d6b
commit 44d3587
Showing
5 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ executables: | |
|
||
tests: | ||
spec: | ||
main: Spec.hs | ||
main: Main.hs | ||
source-dirs: | ||
- test | ||
- src | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
module Ast.UsedNamesSpec where | ||
|
||
import Control.Exception | ||
import Data.Foldable | ||
import Data.List | ||
import Test.Hspec | ||
|
||
import Ast.UsedNames | ||
|
||
spec :: Spec | ||
spec = do | ||
let errs :: [(String, ())] | ||
errs = | ||
("errorNyiData", errorNyiData ()) : | ||
("errorNyiOutputable", errorNyiOutputable ()) : | ||
[] | ||
forM_ errs $ \ (name, err) -> do | ||
describe name $ do | ||
it "explains that this is not yet implemented" $ do | ||
seq err (return ()) `shouldThrow` \ (ErrorCall message) -> | ||
"not yet implemented" `isInfixOf` message | ||
|
||
it "points to the issue tracker" $ do | ||
seq err (return ()) `shouldThrow` \ (ErrorCall message) -> | ||
"https://github.com/soenkehahn/dead-code-detection/issues" `isInfixOf` | ||
message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
module Main where | ||
|
||
import GHC (runGhc) | ||
import GHC.Paths (libdir) | ||
|
||
import qualified Spec | ||
|
||
main :: IO () | ||
main = do | ||
runGhc (Just libdir) (return ()) | ||
Spec.main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{-# OPTIONS_GHC -F -pgmF hspec-discover #-} | ||
{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-} |