Skip to content

Commit 97169f6

Browse files
Add tests and fix bug
1 parent c957849 commit 97169f6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Constrained/NumOrd.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ instance Logic IntW where
895895
constrained $ \ x ->
896896
[ x `satisfies` notMemberSpec [0] | not $ ok 0 ] ++
897897
[ Assert $ 0 <=. x | not $ ok (-1) ] ++
898-
[ Assert $ x <=. x | not $ ok 1 ]
898+
[ Assert $ x <=. 0 | not $ ok 1 ]
899899
where ok = flip conformsToSpec (TypeSpec ts cant)
900900

901901
propagateMemberSpec AddW (HOLE :<: i) es =
@@ -919,7 +919,7 @@ instance Logic IntW where
919919
| otherwise = constrained $ \ x ->
920920
[ x `satisfies` notMemberSpec [0] | 0 `notElem` es ] ++
921921
[ Assert $ 0 <=. x | -1 `notElem` es ] ++
922-
[ Assert $ x <=. x | 1 `notElem` es ]
922+
[ Assert $ x <=. 0 | 1 `notElem` es ]
923923

924924
rewriteRules AddW (x :> y :> Nil) _ | x == y = Just $ 2 * x
925925
rewriteRules _ _ _ = Nothing

src/Constrained/Test.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,15 @@ instance QC.Arbitrary TestableFn where
398398
, TestableFn $ NegateW @Int
399399
, TestableFn $ MultW @Int
400400
, TestableFn $ MultW @Integer
401+
, TestableFn $ SignumW @Integer
401402
-- These are representative of the bounded types
402403
, TestableFn $ MultW @Word8
404+
, TestableFn $ SignumW @Word8
403405
, TestableFn $ MultW @Int8
404406
, TestableFn $ MultW @Float
407+
, TestableFn $ SignumW @Float
405408
, TestableFn $ MultW @Double
409+
, TestableFn $ SignumW @Double
406410
, TestableFn $ SizeOfW @(Map Int Int)
407411
, -- data BaseW
408412
TestableFn $ EqualW @Int

0 commit comments

Comments
 (0)