Function
benchmarkConnWrite
(b *testing.B, conn *Conn, _ []byte)
Source from the content-addressed store, hash-verified
| 1303 | } |
| 1304 | |
| 1305 | func benchmarkConnWrite(b *testing.B, conn *Conn, _ []byte) { |
| 1306 | a := make([]byte, 10e3) // 10 KB |
| 1307 | n := 0 |
| 1308 | i := 0 |
| 1309 | |
| 1310 | for i != b.N { |
| 1311 | c, err := conn.Write(a) |
| 1312 | if err != nil { |
| 1313 | b.Error(err) |
| 1314 | return |
| 1315 | } |
| 1316 | n += c |
| 1317 | i++ |
| 1318 | } |
| 1319 | |
| 1320 | b.SetBytes(int64(n / i)) |
| 1321 | } |
| 1322 | |
| 1323 | func TestEmptyToNullableReturnsNil(t *testing.T) { |
| 1324 | if emptyToNullable("") != nil { |
Callers
nothing calls this directly
Tested by
no test coverage detected