From 50ae155a7fc075694eba6edc2cbc5419ed2731b7 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 13 Mar 2025 21:25:55 +0100 Subject: add normalization --- test/Spec.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/Spec.hs b/test/Spec.hs index f42712a..6cf4d2f 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -35,6 +35,14 @@ main = property $ \(x :: Blessings String) -> x <> mempty == x && x == mempty <> x + it "pp (normalize x) == pp x" $ + property $ \(x :: Blessings String) -> + pp (stripSGR (normalize x)) == pp (stripSGR x) + + it "take 1 x <> drop 1 x == x" $ + property $ \(x :: Blessings String) -> + normalize (B.take 1 x <> B.drop 1 x) == normalize x + let infx = mconcat (repeat (Plain "x" :: Blessings String)) it "can take from infinite structure" $ -- cgit v1.2.3