Update has() function logic to cache test results