lib/querytracer: fix remaining tests after 49ebc48809

This commit is contained in:
Aliaksandr Valialkin 2022-12-08 18:18:06 -08:00
parent 5b9e6b9d24
commit 8434aa142d
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()
s := qt.String()
sExpected := `- 0ms: parent
sExpected := `- 0ms: : parent
| - 0ms: first_line
| - 0ms: child
| - 0ms: : child
| | - 0ms: foo
| - 0ms: last_line
`
@ -120,9 +120,9 @@ func TestTraceAddJSON(t *testing.T) {
}
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":"child","children":[` +
`{"duration_msec":0,"message":": child","children":[` +
`{"duration_msec":0,"message":"foo"}]},` +
`{"duration_msec":0,"message":"last_line"}]}`
if !areEqualJSONTracesSkipDuration(jsonS, jsonSExpected) {
@ -137,7 +137,7 @@ func TestTraceMissingDonef(t *testing.T) {
qtChild.Printf("child printf")
qt.Printf("another parent printf")
s := qt.String()
sExpected := `- 0ms: parent: missing Tracer.Done() call
sExpected := `- 0ms: : parent: missing Tracer.Done() call
| - 0ms: parent printf
| - 0ms: child: missing Tracer.Done() call
| | - 0ms: child printf