fixed buggy test_key() for multifile test case