t5411: refactor check of refs using test_cmp_refs