This patch unifies the functions that generated the tree
reorganisation discussion in the first place :)
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
-- | Function for testing whether a file is parsed correctly.
testFile :: String -> DRBDStatus -> Assertion
testFile fileName expectedContent = do
- fileContent <- readPythonTestData fileName
+ fileContent <- readTestData fileName
case A.parseOnly drbdStatusParser $ pack fileContent of
Left msg -> assertFailure $ "Parsing failed: " ++ msg
Right obtained -> assertEqual fileName expectedContent obtained
src <- getSourceDir
return $ src ++ datadir ++ name
--- | Returns the content of the specified python test data file.
-readPythonTestData :: String -> IO String
-readPythonTestData filename = do
- name <- testDataFilename "/test/data/" filename
- readFile name
-
-- | Returns the content of the specified haskell test data file.
readTestData :: String -> IO String
readTestData filename = do
- name <- testDataFilename "/test/data/htools/" filename
+ name <- testDataFilename "/test/data/" filename
readFile name