(t *testing.T)
| 529 | } |
| 530 | |
| 531 | func Test_matchesAny(t *testing.T) { |
| 532 | tests := []struct { |
| 533 | name string |
| 534 | filename string |
| 535 | patterns []string |
| 536 | want bool |
| 537 | }{ |
| 538 | { |
| 539 | name: "exact match", |
| 540 | filename: "Makefile", |
| 541 | patterns: []string{"Makefile"}, |
| 542 | want: true, |
| 543 | }, |
| 544 | { |
| 545 | name: "glob extension", |
| 546 | filename: ".github/workflows/releases.yml", |
| 547 | patterns: []string{"*.yml"}, |
| 548 | want: true, |
| 549 | }, |
| 550 | { |
| 551 | name: "no match", |
| 552 | filename: "main.go", |
| 553 | patterns: []string{"*.yml"}, |
| 554 | want: false, |
| 555 | }, |
| 556 | { |
| 557 | name: "directory glob", |
| 558 | filename: ".github/workflows/releases.yml", |
| 559 | patterns: []string{".github/*/*"}, |
| 560 | want: true, |
| 561 | }, |
| 562 | } |
| 563 | for _, tt := range tests { |
| 564 | t.Run(tt.name, func(t *testing.T) { |
| 565 | assert.Equal(t, tt.want, matchesAny(tt.filename, tt.patterns)) |
| 566 | }) |
| 567 | } |
| 568 | } |
| 569 | |
| 570 | func Test_sanitizedReader(t *testing.T) { |
| 571 | input := strings.NewReader("\t hello \x1B[m world! ăѣ𝔠ծề\r\n") |
nothing calls this directly
no test coverage detected