Skip to content

Commit ecaac2f

Browse files
author
Matt Allen
committed
Implemented 'isValidFolderPath'
1 parent b3951c1 commit ecaac2f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

validate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ func doesFileExist(p string) bool {
1616
}
1717

1818
func isValidFolderPath(s string) bool {
19-
return true
19+
return doesFileExist(s)
2020
}

validate_test.go

+8
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@ func TestDoesFileExist(t *testing.T) {
1515
assert.True(t, doesFileExist("lock.go"))
1616
assert.False(t, doesFileExist("<.txt"))
1717
}
18+
19+
func TestIsValidFilePath(t *testing.T) {
20+
assert.True(t, isValidFolderPath("."))
21+
assert.True(t, isValidFolderPath("./tests"))
22+
assert.True(t, isValidFolderPath("tests"))
23+
assert.False(t, isValidFolderPath("./testies"))
24+
assert.False(t, isValidFolderPath("testies"))
25+
}

0 commit comments

Comments
 (0)