plugins/vendor/github.com/Microsoft/hcsshim/internal/runhcs/util_test.go
Nathan Gieseker 9a429d8d25 Windows: Updates Windows Vendoring
Updates windows dependent libraries for vendoing.
2019-01-23 18:43:18 -08:00

18 lines
477 B
Go

package runhcs
import (
"testing"
)
func Test_SafePipePath(t *testing.T) {
tests := []string{"test", "test with spaces", "test/with\\\\.\\slashes", "test.with..dots..."}
expected := []string{"test", "test%20with%20spaces", "test%2Fwith%5C%5C.%5Cslashes", "test.with..dots..."}
for i, test := range tests {
actual := SafePipePath(test)
e := SafePipePrefix + expected[i]
if actual != e {
t.Fatalf("SafePipePath: actual '%s' != '%s'", actual, expected[i])
}
}
}