Add test for heap dependencies

We just use a List for now but any heap object would work.

I am not certain whether this is the behavior that we want to model
but for now this new test captures the behavior and we can tweak it
later.

See #30.