improved search test, return only class name if test function is outside of the class