(t *testing.T)
| 350 | } |
| 351 | |
| 352 | func TestPadTraceIDTo16Bytes(t *testing.T) { |
| 353 | tc := []struct { |
| 354 | name string |
| 355 | tid []byte |
| 356 | expected []byte |
| 357 | }{ |
| 358 | { |
| 359 | name: "small", |
| 360 | tid: []byte{0x01, 0x02}, |
| 361 | expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02}, |
| 362 | }, |
| 363 | { |
| 364 | name: "exact", |
| 365 | tid: []byte{0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02}, |
| 366 | expected: []byte{0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02}, |
| 367 | }, |
| 368 | { // least significant bits are preserved |
| 369 | name: "large", |
| 370 | tid: []byte{0x05, 0x05, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02}, |
| 371 | expected: []byte{0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02}, |
| 372 | }, |
| 373 | } |
| 374 | |
| 375 | for _, tt := range tc { |
| 376 | t.Run(tt.name, func(t *testing.T) { |
| 377 | assert.Equal(t, tt.expected, PadTraceIDTo16Bytes(tt.tid)) |
| 378 | }) |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | func TestHexStringToSpanID(t *testing.T) { |
| 383 | tc := []struct { |
nothing calls this directly
no test coverage detected