From 463ab9a26f0a141b41c4fe1197da03d94a784964 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Tue, 12 Aug 2014 16:37:05 +0900 Subject: [PATCH] adding a test for foreign export. --- test/CheckSpec.hs | 5 +++++ test/data/ForeignExport.hs | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 test/data/ForeignExport.hs diff --git a/test/CheckSpec.hs b/test/CheckSpec.hs index 5fee185..c492701 100644 --- a/test/CheckSpec.hs +++ b/test/CheckSpec.hs @@ -31,6 +31,11 @@ spec = do res <- runID $ checkSyntax ["Baz.hs"] res `shouldSatisfy` ("Baz.hs:5:1:Warning:" `isPrefixOf`) + it "works with foreign exports" $ do + withDirectory_ "test/data" $ do + res <- runID $ checkSyntax ["ForeignExport.hs"] + res `shouldBe` "" + context "when no errors are found" $ do it "doesn't output an empty line" $ do withDirectory_ "test/data/ghc-mod-check/Data" $ do diff --git a/test/data/ForeignExport.hs b/test/data/ForeignExport.hs new file mode 100644 index 0000000..9a55b96 --- /dev/null +++ b/test/data/ForeignExport.hs @@ -0,0 +1,10 @@ +{-# LANGUAGE ForeignFunctionInterface #-} + +module ForeignExport where + +import Foreign.C.Types + +foreign export ccall foo :: CUInt + +foo :: CUInt +foo = 123