mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:21:50 +00:00
23 lines
443 B
Go
23 lines
443 B
Go
package pathexistence
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestDirWithoutDot(t *testing.T) {
|
|
testCases := []struct {
|
|
actual string
|
|
expected string
|
|
}{
|
|
{dirWithoutDot("foo.txt"), ""},
|
|
{dirWithoutDot("foo/bar.txt"), "foo"},
|
|
{dirWithoutDot("foo/baz"), "foo"},
|
|
}
|
|
|
|
for _, testCase := range testCases {
|
|
if testCase.actual != testCase.expected {
|
|
t.Errorf("unexpected dirname: want=%s got=%s", testCase.expected, testCase.actual)
|
|
}
|
|
}
|
|
}
|