add test cases with method from another package

This is the old test case from #977 .
Three test cases failed, because they are failed in the master branch.