diff --git a/test/AlignmentSpec.hs b/test/AlignmentSpec.hs index 3baed4964..4091e254a 100644 --- a/test/AlignmentSpec.hs +++ b/test/AlignmentSpec.hs @@ -105,6 +105,10 @@ spec = parallel $ do (info 12 12 `branch` [])) ] + it "aligns identical branches with multiple children on the same line" $ + alignDiff (pure (Source.fromList "[ foo, bar, baz ]")) (pure (info 0 17) `branch` [ pure (info 2 5) `leaf` "foo", pure (info 7 10) `leaf` "bar", pure (info 12 15) `leaf` "baz" ]) `shouldBe` + [ Join (runBothWith These (pure (info 0 17 `branch` [ info 2 5 `leaf` "foo", info 7 10 `leaf` "bar", info 12 15 `leaf` "baz" ])) ) ] + where isOnSingleLine (a, _, _) = filter (/= '\n') (toString a) == toString a