implemented right

This commit is contained in:
Jonathan Lamothe
2019-09-02 09:40:57 -04:00
parent 60c662396f
commit 6145dd5c0c
2 changed files with 22 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ spec :: Spec
spec = describe "Mtlstats.Format" $ do
padNumSpec
leftSpec
rightSpec
padNumSpec :: Spec
padNumSpec = describe "padNum" $ do
@@ -63,3 +64,14 @@ leftSpec = describe "left" $ do
context "overflow" $
it "should truncate the text" $
left 2 "foo" `shouldBe` "fo"
rightSpec :: Spec
rightSpec = describe "right" $ do
context "fit" $
it "should pad the text" $
right 5 "foo" `shouldBe` " foo"
context "overflow" $
it "should truncate the text" $
right 2 "foo" `shouldBe` "oo"