File: ToValueSpec.hs

package info (click to toggle)
haskell-toml-parser 2.0.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 320 kB
  • sloc: haskell: 3,364; yacc: 131; makefile: 3
file content (17 lines) | stat: -rw-r--r-- 495 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# Language OverloadedStrings #-}
module ToValueSpec where

import Test.Hspec (it, shouldBe, Spec)
import Toml (Value'(Integer, Text, List))
import Toml.Schema (ToValue(toValue))

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

    it "converts strings normally" $
        toValue ("demo" :: String) `shouldBe` Text "demo"

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