Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ekmett/lens
Browse files Browse the repository at this point in the history
  • Loading branch information
ekmett committed Dec 7, 2012
2 parents 52df98e + 261a3c5 commit ccf59fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/properties.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ import Test.QuickCheck
import Test.QuickCheck.All
import Test.QuickCheck.Function
import Data.Text.Strict.Lens
import Data.List.Lens

setter_id :: Eq s => Simple Setter s a -> s -> Bool
setter_id l s = runIdentity (l Identity s) == s

setter_composition :: Eq s => Simple Setter s a -> s -> Fun a a -> Fun a a -> Bool
setter_composition l s (Fun _ f) (Fun _ g) = mapOf l f (mapOf l g s) == mapOf l (f . g) s
setter_composition l s (Fun _ f) (Fun _ g) = over l f (over l g s) == over l (f . g) s

lens_set_view :: Eq s => Simple Lens s a -> s -> Bool
lens_set_view l s = set l (view l s) s == s
Expand Down Expand Up @@ -98,6 +99,9 @@ prop__left = isPrism (_left :: Simple Prism (Either In
prop__right = isPrism (_right :: Simple Prism (Either Int Bool) Bool)
prop__just = isPrism (_just :: Simple Prism (Maybe Int) Int)

-- Data.List.Lens
prop_strippingPrefix s = isPrism (strippingPrefix s :: Simple Prism String String)

-- Data.Text.Lens
prop_text s = s^.packed.from packed == s
--prop_text = isIso packed
Expand Down

0 comments on commit ccf59fb

Please sign in to comment.