Add a unit test for cacheBlock

Add a unit test for cacheBlock