Fix output repair diagnostics and concurrency tests
This commit is contained in:
@@ -234,6 +234,23 @@ func TestFormatRepairDiagnosticsBoundsAndPreservesData(t *testing.T) {
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "no room for partial diagnostic",
|
||||
errors: func() []string {
|
||||
omission, _ := json.Marshal(omittedRepairDiagnostics)
|
||||
return []string{
|
||||
strings.Repeat("x", maxRepairDiagnosticBytes-len(omission)-5),
|
||||
strings.Repeat("y", 128),
|
||||
}
|
||||
}(),
|
||||
wantOmission: true,
|
||||
check: func(t *testing.T, got []string) {
|
||||
t.Helper()
|
||||
if len(got) != 2 || got[1] != omittedRepairDiagnostics {
|
||||
t.Fatalf("diagnostics = %#v", got)
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "invalid UTF-8",
|
||||
errors: []string{"broken\xffinput"},
|
||||
|
||||
Reference in New Issue
Block a user