Ticket #8406: trac_8406-doctests.patch

File trac_8406-doctests.patch, 960 bytes (added by ylchapuy, 3 years ago)
  • sage/graphs/base/c_graph.pyx

    # HG changeset patch
    # User Yann Laigle-Chapuy <yannlaiglechapuy@gmail.com>
    # Date 1268147196 -3600
    # Node ID 9493d7e861c40b7be12260999bbdc5047aad30d4
    # Parent  4485d8f9d1fc2b733a4f2bd8e2215f01206682e0
    trac 8406-doctests
    
    diff -r 4485d8f9d1fc -r 9493d7e861c4 sage/graphs/base/c_graph.pyx
    a b  
    631631    Returns an int representing the arbitrary hashable vertex u (whether or not 
    632632    u is actually in the graph), or -1 if a new association must be made for u 
    633633    to be a vertex. 
     634 
     635    TESTS: 
     636 
     637        We check that the bug described in #8406 is gone:: 
     638 
     639        sage: G=Graph() 
     640        sage: R.<a>=GF(3**3) 
     641        sage: S.<x>=R[] 
     642        sage: G.add_vertex(a**2) 
     643        sage: G.add_vertex(x) 
     644        sage: G.vertices() 
     645        [a^2, x] 
     646 
    634647    """ 
    635648    if u in vertex_ints: 
    636649        return vertex_ints[u]