Skip to content

Commit

Permalink
Review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rvl committed May 9, 2019
1 parent b424657 commit 5a812c3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/text-class/test/unit/Data/Text/ClassSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ spec = do
in fromText @Int "patate" === Left (TextDecodingError err)
it "fromText . toText === pure"
$ property $ \(i :: Int) -> (fromText . toText) i === pure i
it "fromText ~ fromTextMaybe" $
property $ \(Digits t) ->
classify (isNothing (fromTextMaybe @Int t)) "invalid" $
classify ((compare 0 <$> fromTextMaybe @Int t) == Just GT) "valid negative" $
toList (fromTextMaybe @Int t) === toList (fromText t)

describe "Text" $ do
it "fromText \"patate\"" $
Expand All @@ -60,11 +65,6 @@ spec = do
toText @Text "patate" === "patate"
it "fromText . toText === pure" $
property $ \(t :: Text) -> (fromText . toText) t === pure t
it "fromText ~ fromTextMaybe" $
property $ \(Digits t) ->
classify (isNothing (fromTextMaybe @Int t)) "invalid" $
classify ((compare 0 <$> fromTextMaybe @Int t) == Just GT) "valid negative" $
toList (fromTextMaybe @Int t) === toList (fromText t)

{-------------------------------------------------------------------------------
Arbitrary Instances
Expand Down

0 comments on commit 5a812c3

Please sign in to comment.