on master help sign in
Fix test code
5a19839Evan Czaplicki
tests/Test/Compiler.hs+4−3
@@ -12,7 +12,6 @@ import Test.Framework.Providers.HUnit (testCase)
12import Test.HUnit (Assertion, assertFailure, assertBool)
12import Test.HUnit (Assertion, assertFailure, assertBool)
13
13
14import qualified Elm.Compiler as Compiler
14import qualified Elm.Compiler as Compiler
15−import qualified Elm.Compiler.Module as Module
16
15
17
16
18compilerTests :: Test
17compilerTests :: Test
@@ -45,7 +44,7 @@ testsDir =
45-- RUN COMPILER
44-- RUN COMPILER
46
45
47testIf
46testIf
48− :: (Either String (Module.Interface, String) -> Assertion)
47+ :: (Either String Compiler.Result -> Assertion)
49 -> [FilePath]
48 -> [FilePath]
50 -> IO [Test]
49 -> IO [Test]
51testIf handleResult filePaths =
50testIf handleResult filePaths =
@@ -54,8 +53,10 @@ testIf handleResult filePaths =
54 setupTest filePath = do
53 setupTest filePath = do
55 source <- readFile filePath
54 source <- readFile filePath
56
55
56+ let context =
57+ Compiler.Context "elm-lang" "core" True False
57 let (dealiaser, _warnings, result) =
58 let (dealiaser, _warnings, result) =
58− Compiler.compile "elm-lang" "core" True source Map.empty
59+ Compiler.compile context source Map.empty
59 let formatErrors errors =
60 let formatErrors errors =
60 concatMap (Compiler.errorToString dealiaser filePath source) errors
61 concatMap (Compiler.errorToString dealiaser filePath source) errors
61 let formattedResult =
62 let formattedResult =