MCPcopy Index your code
hub / github.com/jetify-com/devbox / TestCleanEnvPath

Function TestCleanEnvPath

internal/devbox/envpath/pathlists_test.go:7–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5)
6
7func TestCleanEnvPath(t *testing.T) {
8 tests := []struct {
9 name string
10 inPath string
11 outPath string
12 }{
13 {
14 name: "NoEmptyPaths",
15 inPath: "/usr/local/bin::",
16 outPath: "/usr/local/bin",
17 },
18 {
19 name: "NoRelativePaths",
20 inPath: "/usr/local/bin:/usr/bin:../test:/bin:/usr/sbin:/sbin:.:..",
21 outPath: "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
22 },
23 }
24 for _, test := range tests {
25 t.Run(test.name, func(t *testing.T) {
26 got := JoinPathLists(test.inPath)
27 if got != test.outPath {
28 t.Errorf("Got incorrect cleaned PATH.\ngot: %s\nwant: %s", got, test.outPath)
29 }
30 })
31 }
32}

Callers

nothing calls this directly

Calls 2

JoinPathListsFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected