Test anonymous function