Test if pattern caching is working