git.iko.soy/typeable/http-api-data
on master help sign in
[#77] Add `checkEncodedUrlPiece` tests to `Data.Fixed` types
commit83a882563c499a82619fdac884fdd091fcd1655a authorAlexandre Baldé <alexandrer_b@outlook.com> dateTue 2 Oct 2018, 16:43 (8 years ago) parent1a78dfe
1 file changed+9
test/Web/Internal/HttpApiDataSpec.hs+9
test/Web/Internal/HttpApiDataSpec.hs+9
@@ -3,6 +3,7 @@
33module Web.Internal.HttpApiDataSpec (spec) where
44
55import Control.Applicative
6+import qualified Data.Fixed as F
67import Data.Int
78import Data.Word
89import Data.Time
@@ -136,6 +137,14 @@ spec = do
136137 checkEncodedUrlPiece (Proxy :: Proxy Natural) "Natural"
137138#endif
138139
140+ checkEncodedUrlPiece (Proxy :: Proxy F.Uni) "Uni"
141+ checkEncodedUrlPiece (Proxy :: Proxy F.Deci) "Deci"
142+ checkEncodedUrlPiece (Proxy :: Proxy F.Centi) "Centi"
143+ checkEncodedUrlPiece (Proxy :: Proxy F.Milli) "Milli"
144+ checkEncodedUrlPiece (Proxy :: Proxy F.Micro) "Micro"
145+ checkEncodedUrlPiece (Proxy :: Proxy F.Nano) "Nano"
146+ checkEncodedUrlPiece (Proxy :: Proxy F.Pico) "Pico"
147+
139148 it "bad integers are rejected" $ do
140149 parseUrlPieceMaybe (T.pack "123hello") `shouldBe` (Nothing :: Maybe Int)
141150