From a862da9315b5f44d11d5f060ca3f61c2c8451255 Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Wed, 6 May 2020 19:22:54 +1200 Subject: [PATCH] Test basics of counter substitution. --- test/Test.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/Test.hs b/test/Test.hs index 428da82..d935c03 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -493,6 +493,18 @@ spec = do shorthand textStyle "content" [Function "counters", Ident "-rhaps-ol", Comma, String ".", RightParen] `shouldBe` [("content", [Function "counters", Ident "-rhaps-ol", Comma, String ".", RightParen])] + let textStyle1 = fromJust $ longhand temp textStyle "content" [Function "counter", Ident "-rhaps-ol", RightParen] + style (Txt.resolve $ StyleTree textStyle1 []) `shouldBe` TrivialPropertyParser (fromList [("content", [])]) + + let textStyle2 = fromJust $ longhand temp textStyle1 "counter-reset" [Ident "-rhaps-ol"] + style (Txt.resolve $ StyleTree textStyle2 []) `shouldBe` TrivialPropertyParser (fromList [("content", [String "0"])]) + + let textStyle3 = fromJust $ longhand temp textStyle1 "counter-set" [Ident "-rhaps-ol"] + style (Txt.resolve $ StyleTree textStyle3 []) `shouldBe` TrivialPropertyParser (fromList [("content", [String "0"])]) + + let textStyle4 = fromJust $ longhand temp textStyle1 "counter-increment" [Ident "-rhaps-ol"] + style (Txt.resolve $ StyleTree textStyle4 []) `shouldBe` TrivialPropertyParser (fromList [("content", [String "1"])]) + styleIndex :: StyleIndex styleIndex = new queryable :: QueryableStyleSheet (VarParser TrivialPropertyParser) -- 2.30.2