Testing a returned function instead of an overwritten global function.