scientific 0.3.5.1 → 0.3.5.2
raw patch · 3 files changed
+17/−2 lines, 3 filesdep −ghc-primdep ~QuickCheckdep ~basedep ~criterionPVP ok
version bump matches the API change (PVP)
Dependencies removed: ghc-prim
Dependency ranges changed: QuickCheck, base, criterion, tasty, tasty-hunit
API changes (from Hackage documentation)
Files
- changelog +4/−0
- scientific.cabal +1/−2
- test/test.hs +12/−0
changelog view
@@ -1,3 +1,7 @@+0.3.5.2+ * Remove unused ghc-prim dependency.+ * Added unit tests for read and scientificP+ 0.3.5.1 * Replace use of Vector from vector with Array from primitive.
scientific.cabal view
@@ -1,5 +1,5 @@ name: scientific-version: 0.3.5.1+version: 0.3.5.2 synopsis: Numbers represented using scientific notation description: @Data.Scientific@ provides the number type 'Scientific'. Scientific numbers are@@ -67,7 +67,6 @@ other-extensions: DeriveDataTypeable, BangPatterns ghc-options: -Wall build-depends: base >= 4.3 && < 4.11- , ghc-prim , integer-logarithms >= 1 && <1.1 , deepseq >= 1.3 && < 1.5 , text >= 0.8 && < 1.3
test/test.hs view
@@ -34,6 +34,7 @@ import qualified Data.ByteString.Lazy.Char8 as BLC8 import qualified Data.ByteString.Builder.Scientific as B import qualified Data.ByteString.Builder as B+import Text.ParserCombinators.ReadP (readP_to_S) main :: IO () main = testMain $ testGroup "scientific"@@ -55,6 +56,11 @@ , testCase "reads \"(1.3 )\"" $ testReads "(1.3 )" [(1.3, "")] , testCase "reads \"((1.3))\"" $ testReads "((1.3))" [(1.3, "")] , testCase "reads \" 1.3\"" $ testReads " 1.3" [(1.3, "")]+ , testCase "read \" ( (( -1.0e+3 ) ))\"" $ testRead " ( (( -1.0e+3 ) ))" (-1000.0)+ , testCase "scientificP \"3\"" $ testScientificP "3" [(3.0, "")]+ , testCase "scientificP \"3.0e2\"" $ testScientificP "3.0e2" [(3.0, "e2"), (300.0, "")]+ , testCase "scientificP \"+3.0e+2\"" $ testScientificP "+3.0e+2" [(3.0, "e+2"), (300.0, "")]+ , testCase "scientificP \"-3.0e-2\"" $ testScientificP "-3.0e-2" [(-3.0, "e-2"), (-3.0e-2, "")] ] , testGroup "Formatting"@@ -217,6 +223,12 @@ testReads :: String -> [(Scientific, String)] -> Assertion testReads inp out = reads inp @?= out++testRead :: String -> Scientific -> Assertion+testRead inp out = read inp @?= out++testScientificP :: String -> [(Scientific, String)] -> Assertion+testScientificP inp out = readP_to_S Scientific.scientificP inp @?= out genericIsFloating :: RealFrac a => a -> Bool genericIsFloating a = fromInteger (floor a :: Integer) /= a