fix test warnings: redundant Data.Text import, explicit Int types in Map ops
This commit is contained in:
parent
eb374d20f5
commit
54c7502f0f
@ -4,7 +4,7 @@ module Docster.TransformSpec (spec) where
|
||||
|
||||
import Test.Hspec
|
||||
import qualified Data.Map.Strict as Map
|
||||
import Data.Text (Text)
|
||||
import Data.Text()
|
||||
import qualified Data.Text as T
|
||||
import Text.Pandoc.Definition (Inline(..))
|
||||
|
||||
@ -64,21 +64,21 @@ spec = do
|
||||
describe "diagram naming logic" $ do
|
||||
it "first diagram under heading has no suffix" $
|
||||
let baseName = "file_flow"
|
||||
counter = Map.findWithDefault 0 baseName Map.empty
|
||||
counter = Map.findWithDefault (0 :: Int) baseName Map.empty
|
||||
diagName = if counter == 0 then baseName else baseName <> "_" <> T.pack (show counter)
|
||||
in diagName `shouldBe` "file_flow"
|
||||
|
||||
it "second diagram gets _1 suffix" $
|
||||
let baseName = "file_flow"
|
||||
counters = Map.singleton "file_flow" 1
|
||||
counter = Map.findWithDefault 0 baseName counters
|
||||
counters = Map.singleton "file_flow" (1 :: Int)
|
||||
counter = Map.findWithDefault (0 :: Int) baseName counters
|
||||
diagName = if counter == 0 then baseName else baseName <> "_" <> T.pack (show counter)
|
||||
in diagName `shouldBe` "file_flow_1"
|
||||
|
||||
it "third diagram gets _2 suffix" $
|
||||
let baseName = "file_flow"
|
||||
counters = Map.singleton "file_flow" 2
|
||||
counter = Map.findWithDefault 0 baseName counters
|
||||
counters = Map.singleton "file_flow" (2 :: Int)
|
||||
counter = Map.findWithDefault (0 :: Int) baseName counters
|
||||
diagName = if counter == 0 then baseName else baseName <> "_" <> T.pack (show counter)
|
||||
in diagName `shouldBe` "file_flow_2"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user