add test cases with method from another package

This is the old test case from #977 .