diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:36:04 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:36:04 +0000 |
commit | b09c6d56832eb1718c07d74abf3bc6ae3fe4e030 (patch) | |
tree | d2caec2610d4ea887803ec9e9c3cd77136c448ba /dependencies/pkg/mod/github.com/mattn/go-isatty@v0.0.16/isatty_windows_test.go | |
parent | Initial commit. (diff) | |
download | icingadb-b09c6d56832eb1718c07d74abf3bc6ae3fe4e030.tar.xz icingadb-b09c6d56832eb1718c07d74abf3bc6ae3fe4e030.zip |
Adding upstream version 1.1.0.upstream/1.1.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dependencies/pkg/mod/github.com/mattn/go-isatty@v0.0.16/isatty_windows_test.go')
-rw-r--r-- | dependencies/pkg/mod/github.com/mattn/go-isatty@v0.0.16/isatty_windows_test.go | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/dependencies/pkg/mod/github.com/mattn/go-isatty@v0.0.16/isatty_windows_test.go b/dependencies/pkg/mod/github.com/mattn/go-isatty@v0.0.16/isatty_windows_test.go new file mode 100644 index 0000000..1afc869 --- /dev/null +++ b/dependencies/pkg/mod/github.com/mattn/go-isatty@v0.0.16/isatty_windows_test.go @@ -0,0 +1,39 @@ +//go:build windows +// +build windows + +package isatty + +import ( + "testing" +) + +func TestCygwinPipeName(t *testing.T) { + tests := []struct { + name string + result bool + }{ + {``, false}, + {`\msys-`, false}, + {`\cygwin-----`, false}, + {`\msys-x-PTY5-pty1-from-master`, false}, + {`\cygwin-x-PTY5-from-master`, false}, + {`\cygwin-x-pty2-from-toaster`, false}, + {`\cygwin--pty2-from-master`, false}, + {`\\cygwin-x-pty2-from-master`, false}, + {`\cygwin-x-pty2-from-master-`, true}, // for the feature + {`\cygwin-e022582115c10879-pty4-from-master`, true}, + {`\msys-e022582115c10879-pty4-to-master`, true}, + {`\cygwin-e022582115c10879-pty4-to-master`, true}, + {`\Device\NamedPipe\cygwin-e022582115c10879-pty4-from-master`, true}, + {`\Device\NamedPipe\msys-e022582115c10879-pty4-to-master`, true}, + {`Device\NamedPipe\cygwin-e022582115c10879-pty4-to-master`, false}, + } + + for _, test := range tests { + want := test.result + got := isCygwinPipeName(test.name) + if want != got { + t.Fatalf("isatty(%q): got %v, want %v:", test.name, got, want) + } + } +} |