Lines Matching +full:sprintf +full:- +full:js
2 // Use of this source code is governed by a BSD-style
55 // A Converter holds the state of a test-to-JSON conversion.
76 // <many spaces> --- PASS: very/nested/s/u/b/t/e/s/t
164 []byte("--- PASS: "),
165 []byte("--- FAIL: "),
166 []byte("--- SKIP: "),
167 []byte("--- BENCH: "),
212 // "--- PASS: "
213 // "--- FAIL: "
214 // "--- SKIP: "
215 // "--- BENCH: "
240 c.testName = c.report[indent-1].Test
258 if line[0] == '-' { // PASS or FAIL report
262 t, err := strconv.ParseFloat(name[i+2:len(name)-2], 64)
308 e := c.report[len(c.report)-1]
309 c.report = c.report[:len(c.report)-1]
316 // and then emits the final overall package-level pass/fail event.
350 js, err := json.Marshal(e)
352 // Should not happen - event is valid for json.Marshal.
353 c.w.Write([]byte(fmt.Sprintf("testjson internal error: %v\n", err)))
356 js = append(js, '\n')
357 c.w.Write(js)
361 // input-processing callbacks on whole lines or (for long lines that
364 // It should be initialized with b set to a buffer of length 0 but non-zero capacity,
456 // does not end in the middle of a possibly-valid UTF-8 sequence.
459 // splitting at position trimUTF(b[:i]) avoids splitting a UTF-8 sequence.
461 // Scan backward to find non-continuation byte.
463 if c := b[len(b)-i]; c&0xc0 != 0x80 {
467 return len(b) - i
471 return len(b) - i
475 return len(b) - i