Skip to content
This repository has been archived by the owner on Aug 2, 2020. It is now read-only.

Commit

Permalink
Test findModuleFiles.
Browse files Browse the repository at this point in the history
See #197, #210.
  • Loading branch information
snowleopard committed Feb 21, 2016
1 parent 9039a4f commit 1136a62
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Rules/Selftest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Development.Shake
import Test.QuickCheck

import Base
import Oracles.ModuleFiles
import Settings.Builders.Ar (chunksOfSize)
import Way

Expand All @@ -26,6 +27,7 @@ selftestRules =
testMatchVersionedFilePath
testModuleNames
testLookupAll
testModuleFilesOracle

testWays :: Action ()
testWays = do
Expand Down Expand Up @@ -83,3 +85,14 @@ testLookupAll = do
dicts = nubBy ((==) `on` fst) <$> vector 20
extras :: Gen [Int]
extras = vector 20

testModuleFilesOracle :: Action ()
testModuleFilesOracle = do
putBuild $ "==== moduleFilesOracle"
result <- findModuleFiles ["compiler/codeGen", "compiler/parser"]
[ "CodeGen.Platform.ARM"
, "Lexer"
, "Missing.Module"]
test $ result == [ Just "compiler/codeGen/CodeGen/Platform/ARM.hs"
, Just "compiler/parser/Lexer.x"
, Nothing]

0 comments on commit 1136a62

Please sign in to comment.