aboutsummaryrefslogtreecommitdiffstats
path: root/skate/zippy_test.go
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-06-12 01:36:05 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-06-12 01:36:05 +0200
commit8b1bdd3e230bab7f1554b7fd019d64121ade6193 (patch)
tree645b267edc99a9ea905670eb490840f133b10eba /skate/zippy_test.go
parent18b938ff7aac1cef21de05ebd3671ab90b063c87 (diff)
downloadrefcat-8b1bdd3e230bab7f1554b7fd019d64121ade6193.tar.gz
refcat-8b1bdd3e230bab7f1554b7fd019d64121ade6193.zip
deduplication: tweak test
Diffstat (limited to 'skate/zippy_test.go')
-rw-r--r--skate/zippy_test.go43
1 files changed, 35 insertions, 8 deletions
diff --git a/skate/zippy_test.go b/skate/zippy_test.go
index 746bca4..ed982b7 100644
--- a/skate/zippy_test.go
+++ b/skate/zippy_test.go
@@ -140,6 +140,7 @@ func TestMatchedRefsExtend(t *testing.T) {
},
refs: []*Ref{
&Ref{
+ ReleaseIdent: "0000",
Biblio: Biblio{
Title: "Title",
},
@@ -154,12 +155,39 @@ func TestMatchedRefsExtend(t *testing.T) {
RefKey: "K2",
},
&BiblioRef{
- Key: "_3",
- RefIndex: 3,
- RefKey: "K3",
- MatchStatus: StatusUnmatched.Short(),
- MatchReason: ReasonUnknown.Short(),
- SourceYear: "0",
+ Key: "0000_3",
+ SourceReleaseIdent: "0000",
+ RefIndex: 3,
+ RefKey: "K3",
+ MatchStatus: StatusUnmatched.Short(),
+ MatchReason: ReasonUnknown.Short(),
+ SourceYear: "0",
+ },
+ },
+ },
+ {
+ matched: []*BiblioRef{
+ &BiblioRef{
+ SourceReleaseIdent: "pud5shsflfgrth77lmlernavjm",
+ RefIndex: 2,
+ RefKey: "K2",
+ },
+ },
+ refs: []*Ref{
+ &Ref{
+ ReleaseIdent: "0000",
+ Biblio: Biblio{
+ Title: "Title",
+ },
+ Index: 2,
+ Key: "K2",
+ },
+ },
+ result: []*BiblioRef{
+ &BiblioRef{
+ SourceReleaseIdent: "pud5shsflfgrth77lmlernavjm",
+ RefIndex: 2,
+ RefKey: "K2",
},
},
},
@@ -167,8 +195,7 @@ func TestMatchedRefsExtend(t *testing.T) {
for _, c := range cases {
result := matchedRefsExtend(c.matched, c.refs)
if !reflect.DeepEqual(result, c.result) {
- t.Logf("got %v", pretty.Diff(result, c.result))
- t.Fatalf("got %v, want %v", result, c.result)
+ t.Fatalf("got %v, want %v (%v)", result, c.result, pretty.Diff(result, c.result))
}
}
}