Skip to content

Commit

Permalink
test: updated TestDataRequestsDiff to correspond to updates to datset…
Browse files Browse the repository at this point in the history
…Differ
  • Loading branch information
Thomas Osterbind committed Feb 2, 2018
1 parent 8e1aa39 commit f1caad5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/datasets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,15 @@ func TestDataRequestsDiff(t *testing.T) {
//test cases
cases := []struct {
dsLeft, dsRight *dataset.Dataset
displayFormat string
expected string
err string
}{
{dsBase, dsNewStructure, "Structure: 3 changes\n\t- modified checksum\n\t- modified length\n\t- modified schema", ""},
{dsBase, dsNewStructure, "listKeys", "Structure: 3 changes\n\t- modified checksum\n\t- modified length\n\t- modified schema", ""},
}
// execute
for i, c := range cases {
got, err := datasetDiffer.DiffDatasets(c.dsLeft, c.dsRight)
got, err := datasetDiffer.DiffDatasets(c.dsLeft, c.dsRight, nil)
if err != nil {
if err.Error() == c.err {
continue
Expand All @@ -436,7 +437,10 @@ func TestDataRequestsDiff(t *testing.T) {
return
}
}
stringDiffs := datasetDiffer.MapDiffsToString(got)
stringDiffs, err := datasetDiffer.MapDiffsToString(got, c.displayFormat)
if err != nil {
t.Errorf("case %d error mapping to string: %s", err.Error())
}
if stringDiffs != c.expected {
t.Errorf("case %d response mistmatch: expected '%s', got '%s'", i, c.expected, stringDiffs)
}
Expand Down

0 comments on commit f1caad5

Please sign in to comment.