check function instead of returned value to detect the function is a generator
rewriting tests...