@@ -23,9 +23,11 @@ spec = testGroup "Semantic.CLI"
2323 , testGroup " parseTermBuilder" $ fmap testForParseFixture parseFixtures
2424 ]
2525
26- -- If you're investigating these tests and find this output hard to read
27- -- the `jd` CLI tool (https://github.com/josephburnett/jd) will print
28- -- a detailed summary of the differences between these JSON files.
26+ -- We provide this function to the golden tests so as to have better
27+ -- output when diffing JSON outputs. If you're investigating these
28+ -- tests and find this output hard to read, install the `jd` CLI tool
29+ -- (https://github.com/josephburnett/jd), which will print a detailed
30+ -- summary of the differences between these JSON files.
2931renderDiff :: String -> String -> [String ]
3032renderDiff ref new = unsafePerformIO $ do
3133 useJD <- (isExtensionOf " .json" ref && ) <$> fmap isJust (findExecutable " jd" )
@@ -34,19 +36,16 @@ renderDiff ref new = unsafePerformIO $ do
3436 else [" git" , " diff" , ref, new]
3537{-# NOINLINE renderDiff #-}
3638
37-
38- -- PT TODO: reduce duplication
39-
4039testForDiffFixture (diffRenderer, runDiff, files, expected) =
4140 goldenVsStringDiff
42- (" renders to " <> diffRenderer)
41+ (" diff fixture renders to " <> diffRenderer <> " " <> show files )
4342 renderDiff
4443 expected
4544 (fmap toLazyByteString . runTaskOrDie $ readBlobPairs (Right files) >>= runDiff)
4645
4746testForParseFixture (format, runParse, files, expected) =
4847 goldenVsStringDiff
49- (" renders to " <> format)
48+ (" diff fixture renders to " <> format <> " " <> show files )
5049 renderDiff
5150 expected
5251 (fmap toLazyByteString . runTaskOrDie $ readBlobs (FilesFromPaths files) >>= runParse)
0 commit comments