sourcegraph/lib/codeintel/pathexistence/paths_test.go
Eric Fritz 9158fdf0f4
codeintel: Move ./enterprise/lib to ./lib (#20969)
* Move enterprise/lib/codeintel/* to lib.
2021-05-13 19:17:14 -07:00

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)
}
}
}