@@ -2,14 +2,14 @@ module Test.Main where
22
33import Prelude
44
5+import Data.Fixed (class KnownPrecision, Fixed, PProxy, fromNumber, toNumber, fromString, reifyPrecision, reflectPrecision, toString, P100)
56import Data.BigInt as BigInt
6−import Data.Fixed (class KnownPrecision, Fixed, PProxy, fromNumber, toNumber, fromString, reifyPrecision, reflectPrecision, toString)
77import Data.Maybe (Maybe(..), fromJust, isJust)
88import Effect (Effect)
99import Effect.Console (log)
1010import Math as Math
1111import Partial.Unsafe (unsafePartial)
12−import Test.QuickCheck (arbitrary, quickCheck', (<?>))
12+import Test.QuickCheck (arbitrary, quickCheck', (<?>), (===))
1313import Test.QuickCheck.Gen (Gen, chooseInt, suchThat)
1414
1515-- Just here to package up the safe use of `unsafePartial`.
@@ -91,6 +91,11 @@ main = do
9191 log "Parsing/printing"
9292 log ""
9393
94+ log "An empty string parses Nothing"
95+ quickCheck' 1
96+ let x = fromString "" :: Maybe (Fixed P100)
97+ in x === Nothing
98+
9499 log "Roundtrip: fromString <<< toString == Just"
95100 quickCheck' 1000 do
96101 precision <- chooseInt 0 100