File: TextSpec.hs

package info (click to toggle)
haskell-rio 0.1.22.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 500 kB
  • sloc: haskell: 4,858; makefile: 3
file content (16 lines) | stat: -rw-r--r-- 499 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module RIO.TextSpec where

import Test.Hspec
import RIO
import qualified RIO.Text as T

spec :: Spec
spec = do
  describe "dropPrefix" $ do
    it "present" $ T.dropPrefix "foo" "foobar" `shouldBe` "bar"
    it "absent" $ T.dropPrefix "bar" "foobar" `shouldBe` "foobar"
  describe "dropSuffix" $ do
    it "present" $ T.dropSuffix "bar" "foobar" `shouldBe` "foo"
    it "absent" $ T.dropSuffix "foo" "foobar" `shouldBe` "foobar"