(t *testing.T)
| 789 | } |
| 790 | |
| 791 | func TestResolveSources_URLEncodedKey(t *testing.T) { |
| 792 | t.Parallel() |
| 793 | |
| 794 | testURL := "https://example.com/agent.yaml?agentTag=v1.0.0-dev&origin=cli" |
| 795 | |
| 796 | sources, err := ResolveSources(testURL, nil) |
| 797 | require.NoError(t, err) |
| 798 | require.Len(t, sources, 1) |
| 799 | |
| 800 | // The key should be the URL-encoded version of the URL |
| 801 | expectedKey := url.QueryEscape(testURL) |
| 802 | source, ok := sources[expectedKey] |
| 803 | require.True(t, ok, "expected source key '%s'", expectedKey) |
| 804 | |
| 805 | // The source Name() should still return the original URL for fetching |
| 806 | assert.Equal(t, testURL, source.Name()) |
| 807 | } |
| 808 | |
| 809 | func TestStableSourceKey(t *testing.T) { |
| 810 | t.Parallel() |
nothing calls this directly
no test coverage detected