# 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


5366  5366  (x^2*z^2 + 20)*y^2 + (4*x + 21*z)*y + x*z + 4*z^2 
5367  5367  sage: f.collect(z) 
5368  5368  (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 
5369  5379  """ 
5370  5380  cdef Expression s0 = self.coerce_in(s) 
5371  5381  cdef GEx x 