|
|
@ -77,6 +77,7 @@ func path(filename string) string {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func compare(actual []byte, filename string) error {
|
|
|
|
func compare(actual []byte, filename string) error {
|
|
|
|
|
|
|
|
actual = normalize(actual)
|
|
|
|
if err := update(filename, actual); err != nil {
|
|
|
|
if err := update(filename, actual); err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -85,6 +86,7 @@ func compare(actual []byte, filename string) error {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return errors.Wrapf(err, "unable to read testdata %s", filename)
|
|
|
|
return errors.Wrapf(err, "unable to read testdata %s", filename)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
expected = normalize(expected)
|
|
|
|
if !bytes.Equal(expected, actual) {
|
|
|
|
if !bytes.Equal(expected, actual) {
|
|
|
|
return errors.Errorf("does not match golden file %s\n\nWANT:\n'%s'\n\nGOT:\n'%s'\n", filename, expected, actual)
|
|
|
|
return errors.Errorf("does not match golden file %s\n\nWANT:\n'%s'\n\nGOT:\n'%s'\n", filename, expected, actual)
|
|
|
|
}
|
|
|
|
}
|
|
|
|