(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestNormalizeWorkflowName(t *testing.T) { |
| 10 | tests := []struct { |
| 11 | name string |
| 12 | input string |
| 13 | expected string |
| 14 | }{ |
| 15 | { |
| 16 | name: "name without extension", |
| 17 | input: "weekly-research", |
| 18 | expected: "weekly-research", |
| 19 | }, |
| 20 | { |
| 21 | name: "name with .md extension", |
| 22 | input: "weekly-research.md", |
| 23 | expected: "weekly-research", |
| 24 | }, |
| 25 | { |
| 26 | name: "name with .lock.yml extension", |
| 27 | input: "weekly-research.lock.yml", |
| 28 | expected: "weekly-research", |
| 29 | }, |
| 30 | { |
| 31 | name: "name with dots in filename", |
| 32 | input: "my.workflow.md", |
| 33 | expected: "my.workflow", |
| 34 | }, |
| 35 | { |
| 36 | name: "name with dots and lock.yml", |
| 37 | input: "my.workflow.lock.yml", |
| 38 | expected: "my.workflow", |
| 39 | }, |
| 40 | { |
| 41 | name: "name with other extension", |
| 42 | input: "workflow.yaml", |
| 43 | expected: "workflow.yaml", |
| 44 | }, |
| 45 | { |
| 46 | name: "simple name", |
| 47 | input: "agent", |
| 48 | expected: "agent", |
| 49 | }, |
| 50 | { |
| 51 | name: "empty string", |
| 52 | input: "", |
| 53 | expected: "", |
| 54 | }, |
| 55 | { |
| 56 | name: "just .md", |
| 57 | input: ".md", |
| 58 | expected: "", |
| 59 | }, |
| 60 | { |
| 61 | name: "just .lock.yml", |
| 62 | input: ".lock.yml", |
| 63 | expected: "", |
| 64 | }, |
| 65 | { |
| 66 | name: "multiple extensions priority", |
nothing calls this directly
no test coverage detected