More efficient test for get_key_name_pattern()  #2