Add test for cleanup()