summaryrefslogtreecommitdiffhomepage
path: root/test/Plugins/Monitors/CommonSpec.hs
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2018-11-25 19:14:03 +0000
committerjao <jao@gnu.org>2018-11-25 19:14:03 +0000
commite04d4c6eb84d5adfe62b6a538e7c4008974424b2 (patch)
treec286e983bbd9902375ebce9683592109fb244595 /test/Plugins/Monitors/CommonSpec.hs
parentf86bbb8ca5d3ba0d18e333cbe6cb57cc17e3ae07 (diff)
downloadxmobar-e04d4c6eb84d5adfe62b6a538e7c4008974424b2.tar.gz
xmobar-e04d4c6eb84d5adfe62b6a538e7c4008974424b2.tar.bz2
Test namespaces inside Xmobar
Diffstat (limited to 'test/Plugins/Monitors/CommonSpec.hs')
-rw-r--r--test/Plugins/Monitors/CommonSpec.hs29
1 files changed, 0 insertions, 29 deletions
diff --git a/test/Plugins/Monitors/CommonSpec.hs b/test/Plugins/Monitors/CommonSpec.hs
deleted file mode 100644
index ee1a5bc..0000000
--- a/test/Plugins/Monitors/CommonSpec.hs
+++ /dev/null
@@ -1,29 +0,0 @@
-module Plugins.Monitors.CommonSpec
- ( main
- , spec
- ) where
-
-import Test.Hspec
-import Xmobar.Plugins.Monitors.Common
-
-main :: IO ()
-main = hspec spec
-
-spec :: Spec
-spec =
- describe "Common.padString" $ do
- it "returns given string when called with default values" $
- do padString 0 0 "" False "" "test" `shouldBe` "test"
-
- it "truncates to max width" $ do
- let maxw = 3
- givenStr = "mylongstr"
- expectedStr = take maxw givenStr
- padString 0 maxw "" False "" givenStr `shouldBe` expectedStr
-
- it "truncates to max width and concatenate with ellipsis" $ do
- let maxw = 3
- givenStr = "mylongstr"
- ellipsis = "..."
- expectedStr = (++ ellipsis) . take 3 $ givenStr
- padString 0 maxw "" False ellipsis givenStr `shouldBe` expectedStr