on master help sign in
Merge pull request #489 from phadej/issue-488

Resolve #488

commit66a5b73182ae5670ecd088301b4e18d93540bfba authorAdam Bergmark <adam@bergmark.nl> dateMon 12 Dec 2016, 17:58 (10 years ago) parent38af5f35f5d81b
1 file changed+6−8
tests/UnitTests.hs+6−8
tests/UnitTests.hs+6−8
@@ -609,18 +609,17 @@ unescapeString = do
609609
610610-- JSONTestSuite
611611
612−jsonTestSuiteTest :: FilePath -> L.ByteString -> Test
613−jsonTestSuiteTest path payload =
614− testCase fileName .
615− assertBool fileName $
616− case take 2 fileName of
612+jsonTestSuiteTest :: FilePath -> Test
613+jsonTestSuiteTest path = testCase fileName $ do
614+ payload <- L.readFile path
615+ let result = eitherDecode payload :: Either String Value
616+ assertBool fileName $ case take 2 fileName of
617617 "i_" -> isRight result
618618 "n_" -> isLeft result
619619 "y_" -> isRight result
620620 _ -> isRight result -- test_transform tests have inconsistent names
621621 where
622622 fileName = takeFileName path
623− result = eitherDecode payload :: Either String Value
624623
625624-- Build a collection of tests based on the current contents of the
626625-- JSONTestSuite test directories.
@@ -641,8 +640,7 @@ jsonTestSuite = do
641640 let ok name = takeExtension name == ".json" &&
642641 not (name `HashSet.member` blacklist)
643642 return . map (dir </>) . filter ok $ entries
644− fmap (testGroup "JSONTestSuite") . forM testPaths $ \path ->
645− jsonTestSuiteTest path <$> L.readFile path
643+ return $ testGroup "JSONTestSuite" $ map jsonTestSuiteTest testPaths
646644
647645-- The set expected-to-be-failing JSONTestSuite tests.
648646-- Not all of these failures are genuine bugs.