MCPcopy Index your code
hub / github.com/docker/cli / TestValidFilePaths

Function TestValidFilePaths

cli/context/store/storeconfig_test.go:38–51  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

36}
37
38func TestValidFilePaths(t *testing.T) {
39 paths := map[string]bool{
40 "tls/_/../../something": false,
41 "tls/../../something": false,
42 "../../something": false,
43 "/tls/absolute/unix/path": false,
44 `C:\tls\absolute\windows\path`: false,
45 "C:/tls/absolute/windows/path": false,
46 }
47 for p, expectedValid := range paths {
48 err := isValidFilePath(p)
49 assert.Equal(t, err == nil, expectedValid, "%q should report valid as: %v", p, expectedValid)
50 }
51}
52
53func TestValidateContextName(t *testing.T) {
54 names := map[string]bool{

Callers

nothing calls this directly

Calls 1

isValidFilePathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…