MCPcopy Create free account
hub / github.com/chainreactors/spray / TestAppendBasePathTreatsValidPathAsDirectory

Function TestAppendBasePathTreatsValidPathAsDirectory

core/pool/pool_test.go:86–105  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func TestAppendBasePathTreatsValidPathAsDirectory(t *testing.T) {
87 tests := []struct {
88 name string
89 in string
90 want string
91 }{
92 {name: "empty", in: "", want: "/"},
93 {name: "root", in: "/", want: "/"},
94 {name: "directory", in: "/xxl-job-admin/", want: "/xxl-job-admin/"},
95 {name: "path without slash", in: "/xxl-job-admin", want: "/xxl-job-admin/"},
96 }
97
98 for _, tt := range tests {
99 t.Run(tt.name, func(t *testing.T) {
100 if got := appendBasePath(tt.in); got != tt.want {
101 t.Fatalf("appendBasePath(%q) = %q, want %q", tt.in, got, tt.want)
102 }
103 })
104 }
105}
106
107func TestAppendDerivationSourcesDoNotCascadePluginOutputs(t *testing.T) {
108 allowed := []parsers.SpraySource{

Callers

nothing calls this directly

Calls 2

appendBasePathFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected