Add tests for graph caching.