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

Commit 0a3c11d

Browse files
author
Patrick Thomson
committed
Better formatting by keeping description lines shorter
1 parent bb86469 commit 0a3c11d

File tree

2 files changed

+27
-25
lines changed

2 files changed

+27
-25
lines changed

test/Assigning/Assignment/Spec.hs

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,35 +44,37 @@ spec = do
4444
`shouldBe`
4545
Right [Out "hello"]
4646

47-
it "distributes through overlapping committed choices, matching the left alternative" $
48-
fst <$> runAssignment "(red (green))" (symbol Red *> children green <|> symbol Red *> children blue) (makeState [node Red 0 13 [node Green 5 12 []]])
49-
`shouldBe`
50-
Right (Out "(green)")
47+
describe "distributing through overlapping committed choices" $ do
5148

52-
it "distributes through overlapping committed choices, matching the right alternative" $
53-
fst <$> runAssignment "(red (blue))" (symbol Red *> children green <|> symbol Red *> children blue) (makeState [node Red 0 12 [node Blue 5 11 []]])
54-
`shouldBe`
55-
Right (Out "(blue)")
49+
it "matches the left alternative" $
50+
fst <$> runAssignment "(red (green))" (symbol Red *> children green <|> symbol Red *> children blue) (makeState [node Red 0 13 [node Green 5 12 []]])
51+
`shouldBe`
52+
Right (Out "(green)")
5653

57-
it "distributes through overlapping committed choices, matching the left alternatives" $
58-
fst <$> runAssignment "magenta green green" (symbol Magenta *> many green <|> symbol Magenta *> many blue) (makeState [node Magenta 0 7 [], node Green 8 13 [], node Green 14 19 []])
59-
`shouldBe`
60-
Right [Out "green", Out "green"]
54+
it "matches the right alternative" $
55+
fst <$> runAssignment "(red (blue))" (symbol Red *> children green <|> symbol Red *> children blue) (makeState [node Red 0 12 [node Blue 5 11 []]])
56+
`shouldBe`
57+
Right (Out "(blue)")
6158

62-
it "distributes through overlapping committed choices, matching the empty list" $
63-
fst <$> runAssignment "magenta" (symbol Magenta *> (Left <$> many green) <|> symbol Magenta *> (Right <$> many blue)) (makeState [node Magenta 0 7 []])
64-
`shouldBe`
65-
Right (Left [])
59+
it "matches the left alternatives" $
60+
fst <$> runAssignment "magenta green green" (symbol Magenta *> many green <|> symbol Magenta *> many blue) (makeState [node Magenta 0 7 [], node Green 8 13 [], node Green 14 19 []])
61+
`shouldBe`
62+
Right [Out "green", Out "green"]
6663

67-
it "distributes through overlapping committed choices, dropping anonymous nodes & matching the left alternative" $
68-
fst <$> runAssignment "magenta green" (symbol Magenta *> green <|> symbol Magenta *> blue) (makeState [node Magenta 0 7 [], node Green 8 13 []])
69-
`shouldBe`
70-
Right (Out "green")
64+
it "matches the empty list" $
65+
fst <$> runAssignment "magenta" (symbol Magenta *> (Left <$> many green) <|> symbol Magenta *> (Right <$> many blue)) (makeState [node Magenta 0 7 []])
66+
`shouldBe`
67+
Right (Left [])
7168

72-
it "distributes through overlapping committed choices, dropping anonymous nodes & matching the right alternative" $
73-
fst <$> runAssignment "magenta blue" (symbol Magenta *> green <|> symbol Magenta *> blue) (makeState [node Magenta 0 7 [], node Blue 8 12 []])
74-
`shouldBe`
75-
Right (Out "blue")
69+
it "drops anonymous nodes & matches the left alternative" $
70+
fst <$> runAssignment "magenta green" (symbol Magenta *> green <|> symbol Magenta *> blue) (makeState [node Magenta 0 7 [], node Green 8 13 []])
71+
`shouldBe`
72+
Right (Out "green")
73+
74+
it "drops anonymous nodes & matches the right alternative" $
75+
fst <$> runAssignment "magenta blue" (symbol Magenta *> green <|> symbol Magenta *> blue) (makeState [node Magenta 0 7 [], node Blue 8 12 []])
76+
`shouldBe`
77+
Right (Out "blue")
7678

7779
it "alternates repetitions, matching the left alternative" $
7880
fst <$> runAssignment "green green" (many green <|> many blue) (makeState [node Green 0 5 [], node Green 6 11 []])

test/Semantic/CLI/Spec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ testForDiffFixture (diffRenderer, runDiff, files, expected) =
4141
testForParseFixture :: (String, [Blob] -> TaskEff Builder, [File], FilePath) -> TestTree
4242
testForParseFixture (format, runParse, files, expected) =
4343
goldenVsStringDiff
44-
("diff fixture renders to " <> format <> " " <> show files)
44+
("diff fixture renders to " <> format)
4545
renderDiff
4646
expected
4747
(fmap toLazyByteString . runTaskOrDie $ readBlobs (FilesFromPaths files) >>= runParse)

0 commit comments

Comments
 (0)