added tests around package lookup logic