MCPcopy Create free account
hub / github.com/bufbuild/buf / TestExt

Function TestExt

private/pkg/normalpath/normalpath_windows_test.go:135–156  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

133}
134
135func TestExt(t *testing.T) {
136 t.Parallel()
137 testExt(t, "", "")
138 testExt(t, ".", ".")
139 testExt(t, ".txt", ".txt")
140 testExt(t, ".txt", ".js.txt")
141 testExt(t, "", "foo")
142 testExt(t, ".txt", "foo.txt")
143 testExt(t, ".txt", "foo.js.txt")
144 testExt(t, "", ".\\foo")
145 testExt(t, ".txt", ".\\foo.txt")
146 testExt(t, ".txt", ".\\foo.js.txt")
147 testExt(t, "", ".\\foo\\bar")
148 testExt(t, ".txt", ".\\foo\\bar.txt")
149 testExt(t, ".txt", ".\\foo\\bar.txt")
150 testExt(t, ".txt", ".\\foo\\bar.js.txt")
151 testExt(t, "", "..\\foo\\bar")
152 testExt(t, ".txt", "..\\foo\\bar.txt")
153 testExt(t, ".txt", "..\\foo\\bar.js.txt")
154 testExt(t, ".txt", "\\\\127.0.0.1\\$d\\foo.txt")
155 testExt(t, ".txt", "c:\\foo.txt")
156}
157
158func testExt(t *testing.T, expected string, input string) {
159 assert.Equal(t, expected, Ext(input))

Callers

nothing calls this directly

Calls 1

testExtFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…