Ticket #9880: trac_9880-doctest_for_9046.patch

File trac_9880-doctest_for_9046.patch, 968 bytes (added by burcin, 9 years ago)
  • sage/symbolic/expression.pyx

    # HG changeset patch
    # User Burcin Erocal <burcin@erocal.org>
    # Date 1341912036 -7200
    # Node ID ea32c89d56fe8870e8a8a91ef93baebb90905998
    # Parent  f1dcaedc6ee657dc4b99232fc7bbf3348f11ce72
    Add doctest with the example in #9046.
    
    diff --git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
    a b  
    53665366            (x^2*z^2 + 20)*y^2 + (4*x + 21*z)*y + x*z + 4*z^2
    53675367            sage: f.collect(z)
    53685368            (x^2*y^2 + 4)*z^2 + (x + 21*y)*z + 4*x*y + 20*y^2
     5369
     5370        TESTS:
     5371
     5372        Check if :trac:`9046` is fixed::
     5373
     5374            sage: var('a b x y z')
     5375            (a, b, x, y, z)
     5376            sage: p = -a*x^3 - a*x*y^2 + 2*b*x^2*y + 2*y^3 + x^2*z + y^2*z + x^2 + y^2 + a*x
     5377            sage: p.collect(x)
     5378            -a*x^3 + (2*b*y + z + 1)*x^2 + 2*y^3 + y^2*z - (a*y^2 - a)*x + y^2
    53695379        """
    53705380        cdef Expression s0 = self.coerce_in(s)
    53715381        cdef GEx x