File: ToValueSpec.hs

package info (click to toggle)
haskell-toml-parser 1.3.2.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 312 kB
  • sloc: haskell: 2,980; yacc: 116; makefile: 3
file content (16 lines) | stat: -rw-r--r-- 436 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module ToValueSpec where

import Test.Hspec (it, shouldBe, Spec)
import Toml (Value(..))
import Toml.ToValue (ToValue(toValue))

spec :: Spec
spec =
 do it "converts characters as singleton strings" $
        toValue '!' `shouldBe` String "!"

    it "converts strings normally" $
        toValue "demo" `shouldBe` String "demo"

    it "converts lists" $
        toValue [1,2,3::Int] `shouldBe` Array [Integer 1, Integer 2, Integer 3]