Skip to content

Commit fb44eae

Browse files
committed
pkg/report: tune tests generation
1. We use empty TITLE and TITLE absence. Let's use TITLE absence by default. 2. FRAME header shouldn't be generated, only updated.
1 parent 638c2a9 commit fb44eae

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/report/report_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ func (test *ParseTest) Equal(other *ParseTest) bool {
6969

7070
func (test *ParseTest) Headers() []byte {
7171
buf := new(bytes.Buffer)
72-
fmt.Fprintf(buf, "TITLE: %v\n", test.Title)
72+
if test.Title != "" {
73+
fmt.Fprintf(buf, "TITLE: %v\n", test.Title)
74+
}
7375
for _, t := range test.AltTitles {
7476
fmt.Fprintf(buf, "ALT: %v\n", t)
7577
}
@@ -293,6 +295,10 @@ func checkReport(t *testing.T, reporter *Reporter, rep *Report, test *ParseTest)
293295

294296
func updateReportTest(t *testing.T, test, parsed *ParseTest) {
295297
buf := new(bytes.Buffer)
298+
if test.Frame == "" {
299+
// Don't create "FRAME:" record, only update existing.
300+
parsed.Frame = ""
301+
}
296302
buf.Write(parsed.Headers())
297303
fmt.Fprintf(buf, "\n%s", test.Log)
298304
if test.HasReport {

0 commit comments

Comments
 (0)