Add tests for CachedType.