MCPcopy
hub / github.com/go-task/task / TestGitNode_CacheKey

Function TestGitNode_CacheKey

taskfile/node_git_test.go:77–104  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

75}
76
77func 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
106func TestGitNode_buildURL(t *testing.T) {
107 t.Parallel()

Callers

nothing calls this directly

Calls 2

CacheKeyMethod · 0.95
NewGitNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…