lib/querytracer: fix remaining tests after 49ebc48809

This commit is contained in:
Aliaksandr Valialkin 2022-12-08 18:18:06 -08:00
parent e56d5e1918
commit 6e390f3b99
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -109,9 +109,9 @@ func TestTraceAddJSON(t *testing.T) {
} }
qt.Done() qt.Done()
s := qt.String() s := qt.String()
sExpected := `- 0ms: parent sExpected := `- 0ms: : parent
| - 0ms: first_line | - 0ms: first_line
| - 0ms: child | - 0ms: : child
| | - 0ms: foo | | - 0ms: foo
| - 0ms: last_line | - 0ms: last_line
` `
@ -120,9 +120,9 @@ func TestTraceAddJSON(t *testing.T) {
} }
jsonS := qt.ToJSON() jsonS := qt.ToJSON()
jsonSExpected := `{"duration_msec":0,"message":"parent","children":[` + jsonSExpected := `{"duration_msec":0,"message":": parent","children":[` +
`{"duration_msec":0,"message":"first_line"},` + `{"duration_msec":0,"message":"first_line"},` +
`{"duration_msec":0,"message":"child","children":[` + `{"duration_msec":0,"message":": child","children":[` +
`{"duration_msec":0,"message":"foo"}]},` + `{"duration_msec":0,"message":"foo"}]},` +
`{"duration_msec":0,"message":"last_line"}]}` `{"duration_msec":0,"message":"last_line"}]}`
if !areEqualJSONTracesSkipDuration(jsonS, jsonSExpected) { if !areEqualJSONTracesSkipDuration(jsonS, jsonSExpected) {
@ -137,7 +137,7 @@ func TestTraceMissingDonef(t *testing.T) {
qtChild.Printf("child printf") qtChild.Printf("child printf")
qt.Printf("another parent printf") qt.Printf("another parent printf")
s := qt.String() s := qt.String()
sExpected := `- 0ms: parent: missing Tracer.Done() call sExpected := `- 0ms: : parent: missing Tracer.Done() call
| - 0ms: parent printf | - 0ms: parent printf
| - 0ms: child: missing Tracer.Done() call | - 0ms: child: missing Tracer.Done() call
| | - 0ms: child printf | | - 0ms: child printf