'Caching must not mix up closures reusing the same code object.'

def test_closures(self):

    def make_closure(x, y):
        def f(z):
            return (y + z)
        return f
    (context, builder, sig, args) = self._context_builder_sig_args()
    clo11 = make_closure(1, 1)
    clo12 = make_closure(1, 2)
    clo22 = make_closure(2, 2)
    res1 = context.compile_internal(builder, clo11, sig, args)
    self.assertEqual(1, len(context.cached_internal_func))
    res2 = context.compile_internal(builder, clo12, sig, args)
    self.assertEqual(2, len(context.cached_internal_func))
    res3 = context.compile_internal(builder, clo22, sig, args)
    self.assertEqual(2, len(context.cached_internal_func))
