Add a simple test for function lifetime