We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1bc8c63 commit b788876Copy full SHA for b788876
utils/utils_test.go
@@ -157,6 +157,26 @@ func TestEllipsize(t *testing.T) {
157
}
158
159
160
+func TestIsUnixAddr(t *testing.T) {
161
+ subtests := []struct {
162
+ name string
163
+ input string
164
+ output bool
165
+ }{
166
+ {"empty", "", false},
167
+ {"slash", "/", true},
168
+ {"unix", "/tmp/sock", true},
169
+ {"ipv4", "192.0.2.1", false},
170
+ {"ipv6", "2001:db8::", false},
171
+ }
172
+
173
+ for _, st := range subtests {
174
+ t.Run(st.name, func(t *testing.T) {
175
+ require.Equal(t, st.output, IsUnixAddr(st.input))
176
+ })
177
178
+}
179
180
func TestChanFromSlice(t *testing.T) {
181
t.Run("Nil", func(t *testing.T) {
182
ch := ChanFromSlice[int](nil)
0 commit comments