generator: mode debug output in case of failure

Signed-off-by: Alexander Bezzubov <bzz@apache.org>
This commit is contained in:
Alexander Bezzubov 2020-03-25 14:20:26 +01:00
parent b0f94ad693
commit 3a5f4b2db1
No known key found for this signature in database
GPG Key ID: 8039F5787EFCD05D

View File

@ -302,6 +302,12 @@ func (s *GeneratorTestSuite) TestGenerationFiles() {
expected := normalizeSpaces(string(gold))
actual := normalizeSpaces(string(out))
assert.Equal(s.T(), expected, actual, "Test %s", test.name)
if expected != actual {
s.T().Logf("%s generated is different from %q", test.name, test.wantOut)
s.T().Logf("Expected %q", expected[:400])
s.T().Logf("Actual %q", actual[:400])
}
}
}