aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--skate/zippy_test.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/skate/zippy_test.go b/skate/zippy_test.go
index 7fd32ae..d51a459 100644
--- a/skate/zippy_test.go
+++ b/skate/zippy_test.go
@@ -31,16 +31,19 @@ func TestLineColumn(t *testing.T) {
func TestUniqueMatches(t *testing.T) {
var cases = []struct {
+ about string
docs []string
result []*BiblioRef
err error
}{
{
+ about: "missing fields are ignored",
docs: []string{`{}`},
result: []*BiblioRef{&BiblioRef{}},
err: nil,
},
{
+ about: "a single doc is passed on",
docs: []string{`{
"source_release_ident": "s1",
"target_release_ident": "t1"}`},
@@ -51,6 +54,7 @@ func TestUniqueMatches(t *testing.T) {
err: nil,
},
{
+ about: "we want to keep the exact match, if available",
docs: []string{`
{"source_release_ident": "s1",
"target_release_ident": "t1",
@@ -70,12 +74,12 @@ func TestUniqueMatches(t *testing.T) {
for _, c := range cases {
result, err := uniqueMatches(c.docs)
if err != c.err {
- t.Fatalf("got %v, want %v", err, c.err)
+ t.Fatalf("got %v, want %v (%s)", err, c.err, c.about)
}
if !reflect.DeepEqual(result, c.result) {
- t.Fatalf("got %#v, want %#v",
+ t.Fatalf("got %#v, want %#v (%s)",
pretty.Sprint(result),
- pretty.Sprint(c.result))
+ pretty.Sprint(c.result), c.about)
}
}
}