Set 15 Ex 7: avoid hexadecimal and octal

closes #29
This commit is contained in:
Joel Kaasinen
2021-06-02 09:42:18 +03:00
parent 34aba18061
commit 4266c5fdba
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -133,6 +133,9 @@ twoPersons name1 age1 employed1 name2 age2 employed2 = todo
--
-- Hint: remember readMaybe
--
-- PS. The tests won't test special cases of Int literals like hexadecimal
-- (0x3a) or octal (0o14).
--
-- Examples:
-- boolOrInt "True" ==> Ok (Left True)
-- boolOrInt "13" ==> Ok (Right 13)
+1 -1
View File
@@ -149,7 +149,7 @@ sow (x:xs) (y:ys) = oneof [fmap (x:) $ sow xs (y:ys)
,fmap (y:) $ sow (x:xs) ys]
ex7_fail = forAll_ $ \(i::Int) ->
forAllBlind (choose ('a','z')) $ \c ->
forAllBlind (choose ('a','n')) $ \c -> -- don't generate 0o or 0x by accident
forAllBlind (shuffle (c:show i)) $ \ni ->
forAll_ $ \(b::Bool) ->
forAllBlind (sow [c] (show b)) $ \nb ->