1
1
mirror of https://github.com/github/semantic.git synced 2025-01-02 20:41:38 +03:00

Merge pull request #684 from github/run-less-tests

Run less tests
This commit is contained in:
Rob Rix 2016-08-10 11:36:02 -04:00 committed by GitHub
commit 78fe3550b0

View File

@ -39,7 +39,7 @@ spec = parallel $ do
paths <- runIO $ examples directory
let tests = correctTests =<< paths
traverse_ (\ (formatName, renderer, paths, output) ->
it (maybe "/dev/null" normalizeName (fst paths) ++ " (" ++ formatName ++ ")") $ testDiff renderer paths output matcher) tests
it (maybe "/dev/null" normalizeName (uncurry (<|>) (runJoin paths)) ++ " (" ++ formatName ++ ")") $ testDiff renderer paths output matcher) tests
correctTests paths@(_, _, Nothing, Nothing, Nothing) = testsForPaths paths
correctTests paths = filter (\(_, _, _, output) -> isJust output) $ testsForPaths paths
@ -58,7 +58,7 @@ examples directory = do
let lookupName name = (lookupNormalized name as, lookupNormalized name bs, lookupNormalized name jsons, lookupNormalized name patches, lookupNormalized name splits)
let keys = normalizeName <$> union as bs
let keys = (normalizeName <$> as) `union` (normalizeName <$> bs)
pure $ lookupName <$> keys
where
lookupNormalized name = find $ (== name) . normalizeName