TestSpec_PublicAPI_FormatCacheKey validates the documented format "repo@version".
(t *testing.T)
| 49 | |
| 50 | // TestSpec_PublicAPI_FormatCacheKey validates the documented format "repo@version". |
| 51 | func TestSpec_PublicAPI_FormatCacheKey(t *testing.T) { |
| 52 | tests := []struct { |
| 53 | name string |
| 54 | repo string |
| 55 | version string |
| 56 | expected string |
| 57 | }{ |
| 58 | { |
| 59 | name: "formats cache key as repo@version", |
| 60 | repo: "actions/checkout", |
| 61 | version: "v4", |
| 62 | expected: "actions/checkout@v4", |
| 63 | }, |
| 64 | { |
| 65 | name: "formats cache key with full semver", |
| 66 | repo: "actions/setup-node", |
| 67 | version: "v3.0.0", |
| 68 | expected: "actions/setup-node@v3.0.0", |
| 69 | }, |
| 70 | } |
| 71 | |
| 72 | for _, tt := range tests { |
| 73 | t.Run(tt.name, func(t *testing.T) { |
| 74 | result := actionpins.FormatCacheKey(tt.repo, tt.version) |
| 75 | assert.Equal(t, tt.expected, result, "FormatCacheKey(%q, %q) should match spec format", tt.repo, tt.version) |
| 76 | }) |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | // TestSpec_PublicAPI_ExtractRepo validates extracting the repository from a uses reference. |
| 81 | func TestSpec_PublicAPI_ExtractRepo(t *testing.T) { |
nothing calls this directly
no test coverage detected