On Sep 22, 2013, at 7:43 PM, Matthew Rocklin <notifications@github.com> wrote:

> In toolz/functoolz/tests/test_core.py:
> 
> > @@ -71,6 +72,22 @@ def f(a, b, c=10):
> >      assert f(c=3)(1, 2) == 9
> >  
> >  
> > +def test_comp():
> > +    assert comp()(0) == 0
> > +    assert comp(inc)(0) == 1
> > +    assert comp(double, inc)(0) == 2
> > +    assert comp(str, even, inc, double)(3) == "False"
> > +    assert groupby(comp(), range(3)) == {0: [0], 1: [1], 2: [2]}
> > +    assert groupby(comp(identity,
> > +                        identity,
> > +                        even), range(3)) == {True: [0, 2], False: [1]}
> > +    small = lambda x: x < 10
> > +    square = lambda x: x * x
> > +    assert groupby(comp(small,
> > +                        square), range(10)) == {True: [0, 1, 2, 3],
> > +                                                False: [4, 5, 6, 7, 8, 9]}
> I think you can make these tests depend only on comp without losing
> 
> anything
> 
> list(map(comp(inc, square), range(4))) == [1, 2, 5, 10]

I added the last test because it actually failed for me at one point.  Also, even your test obviously depends on inc, square, map, range and list.  So, I don't really get your comment.

> —
> Reply to this email directly or view it on GitHub.
>