github.com/Prakhar-Agarwal-byte/moby@v0.0.0-20231027092010-a14e3e8ab87e/daemon/cluster/executor/container/validate_windows_test.go (about) 1 //go:build windows 2 3 package container // import "github.com/Prakhar-Agarwal-byte/moby/daemon/cluster/executor/container" 4 import ( 5 "strings" 6 "testing" 7 8 "github.com/moby/swarmkit/v2/api" 9 ) 10 11 const ( 12 testAbsPath = `c:\foo` 13 testAbsNonExistent = `c:\some-non-existing-host-path\` 14 ) 15 16 func TestControllerValidateMountNamedPipe(t *testing.T) { 17 if _, err := newTestControllerWithMount(api.Mount{ 18 Type: api.MountTypeNamedPipe, 19 Source: "", 20 Target: `\\.\pipe\foo`, 21 }); err == nil || !strings.Contains(err.Error(), "invalid npipe source, source must not be empty") { 22 t.Fatalf("expected error, got: %v", err) 23 } 24 }