()
| 535 | } |
| 536 | |
| 537 | func sampleBinFS() fstest.MapFS { |
| 538 | sha1File := bytes.NewBuffer(nil) |
| 539 | for name, sha := range sampleBinSHAs { |
| 540 | _, _ = fmt.Fprintf(sha1File, "%s *%s\n", sha, name) |
| 541 | } |
| 542 | return fstest.MapFS{ |
| 543 | binCoderSha1: &fstest.MapFile{ |
| 544 | Data: sha1File.Bytes(), |
| 545 | }, |
| 546 | binCoderTarZstd: &fstest.MapFile{ |
| 547 | // echo -n compressed >coder-linux-amd64 |
| 548 | // shasum -b -a 1 coder-linux-amd64 | tee coder.sha1 |
| 549 | // tar cf coder.tar coder.sha1 coder-linux-amd64 |
| 550 | // zstd --long --ultra -22 coder.tar |
| 551 | Data: []byte{ |
| 552 | 0x28, 0xb5, 0x2f, 0xfd, 0x64, 0x00, 0x27, 0xb5, 0x04, 0x00, 0x12, 0x08, |
| 553 | 0x1a, 0x1a, 0x90, 0xa7, 0x0e, 0x00, 0x0c, 0x19, 0x7c, 0xfb, 0xa0, 0xa1, |
| 554 | 0x5d, 0x21, 0xee, 0xae, 0xa8, 0x35, 0x65, 0x26, 0x57, 0x6e, 0x9a, 0xee, |
| 555 | 0xaf, 0x77, 0x94, 0x01, 0xf8, 0xec, 0x3d, 0x86, 0x1c, 0xdc, 0xb1, 0x76, |
| 556 | 0x8d, 0x31, 0x8a, 0x00, 0xf6, 0x77, 0xa9, 0x48, 0x24, 0x06, 0x42, 0xa1, |
| 557 | 0x08, 0x14, 0x4e, 0x67, 0x5f, 0x47, 0x4a, 0x8f, 0xf1, 0x6a, 0x8d, 0xc1, |
| 558 | 0x5a, 0x36, 0xea, 0xb6, 0x16, 0x52, 0x4a, 0x79, 0x7f, 0xbf, 0xb2, 0x77, |
| 559 | 0x63, 0x4b, 0x0e, 0x4b, 0x41, 0x12, 0xe2, 0x25, 0x98, 0x05, 0x73, 0x53, |
| 560 | 0x35, 0x71, 0xf5, 0x68, 0x37, 0xb7, 0x61, 0x45, 0x3e, 0xd9, 0x47, 0x99, |
| 561 | 0x3d, 0x51, 0xd3, 0xe0, 0x09, 0x10, 0xf6, 0xc7, 0x0a, 0x10, 0x20, 0x50, |
| 562 | 0x2b, 0x2e, 0x6d, 0x03, 0xf2, 0x21, 0xef, 0xc7, 0xa8, 0xc4, 0x3b, 0x8c, |
| 563 | 0x03, 0x64, 0x1a, 0xd9, 0x9d, 0x01, 0x60, 0xac, 0x94, 0x5a, 0x08, 0x05, |
| 564 | 0x4d, 0xb2, 0xd1, 0x0a, 0x99, 0x14, 0x48, 0xe3, 0xd9, 0x01, 0x99, 0x1d, |
| 565 | 0xe0, 0xda, 0xd4, 0xbd, 0xd4, 0xc6, 0x51, 0x0d, |
| 566 | }, |
| 567 | }, |
| 568 | } |
| 569 | } |
| 570 | |
| 571 | func TestServingBin(t *testing.T) { |
| 572 | t.Parallel() |
no test coverage detected