Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 3363ecc

Browse files
author
Patrick Thomson
committed
Better comments and test labels.
1 parent acbacbe commit 3363ecc

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

test/Semantic/CLI/Spec.hs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
2931
renderDiff :: String -> String -> [String]
3032
renderDiff 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-
4039
testForDiffFixture (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

4746
testForParseFixture (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

Comments
 (0)