'Register two different collation functions under the same name.
Verify that the last one is actually used.'

def CheckCollationRegisterTwice(self):

    con = sqlite.connect(':memory:')
    con.create_collation('mycoll', cmp)
    con.create_collation('mycoll', (lambda x, y: (- cmp(x, y))))
    result = con.execute("\n                                                select    x    from    (select    'a'    as    x    union    select    'b'    as    x)    order    by    x    collate    mycoll\n                                                ").fetchall()
    if ((result[0][0] != 'b') or (result[1][0] != 'a')):
        self.fail('wrong    collation    function    is    used')
