test for circular reference object passed to function to be memoized