Add tests for cache.