diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-06-19 00:01:51 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-06-19 00:01:51 +0200 |
commit | 2e16173c217c6201c226e48b38f350bfd377393e (patch) | |
tree | fec07c23b74733be39a5ef7183612da22c9c48b4 /skate/zippy_test.go | |
parent | dec49fea12f7809b0ec80dca5d8d688dc1124a57 (diff) | |
download | refcat-2e16173c217c6201c226e48b38f350bfd377393e.tar.gz refcat-2e16173c217c6201c226e48b38f350bfd377393e.zip |
zippy: add test
Diffstat (limited to 'skate/zippy_test.go')
-rw-r--r-- | skate/zippy_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/skate/zippy_test.go b/skate/zippy_test.go index 3e64dd0..f1e8822 100644 --- a/skate/zippy_test.go +++ b/skate/zippy_test.go @@ -129,6 +129,29 @@ func TestUniqueMatches(t *testing.T) { }}, err: nil, }, + { + about: "regression; a buggy sort?", + docs: []string{` + {"_id": "s1_0", + "source_release_ident": "s1", + "target_release_ident": "t1", + "match_status": "exact", + "match_reason": "a"}`, + `{"_id": "s1_1", + "source_release_ident": "s1", + "target_release_ident": "t1", + "match_status": "fuzzy", + "match_reason": "b"}`, + }, + result: []*BiblioRef{&BiblioRef{ + Key: "s1_0", + SourceReleaseIdent: "s1", + TargetReleaseIdent: "t1", + MatchStatus: "exact", + MatchReason: "a", + }}, + err: nil, + }, } for _, c := range cases { result, err := uniqueMatches(c.docs, &statsAugment{}) |