(t *testing.T)
| 75 | } |
| 76 | |
| 77 | func TestGitNode_CacheKey(t *testing.T) { |
| 78 | t.Parallel() |
| 79 | |
| 80 | tests := []struct { |
| 81 | entrypoint string |
| 82 | expectedKey string |
| 83 | }{ |
| 84 | { |
| 85 | entrypoint: "https://github.com/foo/bar.git//directory/Taskfile.yml?ref=main", |
| 86 | expectedKey: "git.github.com.directory.Taskfile.yml.f1ddddac425a538870230a3e38fc0cded4ec5da250797b6cab62c82477718fbb", |
| 87 | }, |
| 88 | { |
| 89 | entrypoint: "https://github.com/foo/bar.git//Taskfile.yml?ref=main", |
| 90 | expectedKey: "git.github.com.Taskfile.yml.39d28c1ff36f973705ae188b991258bbabaffd6d60bcdde9693d157d00d5e3a4", |
| 91 | }, |
| 92 | { |
| 93 | entrypoint: "https://github.com/foo/bar.git//multiple/directory/Taskfile.yml?ref=main", |
| 94 | expectedKey: "git.github.com.directory.Taskfile.yml.1b6d145e01406dcc6c0aa572e5a5d1333be1ccf2cae96d18296d725d86197d31", |
| 95 | }, |
| 96 | } |
| 97 | |
| 98 | for _, tt := range tests { |
| 99 | node, err := NewGitNode(tt.entrypoint, "", false) |
| 100 | require.NoError(t, err) |
| 101 | key := node.CacheKey() |
| 102 | assert.Equal(t, tt.expectedKey, key) |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | func TestGitNode_buildURL(t *testing.T) { |
| 107 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…