Skip to content

Commit

Permalink
test: add missing test for osclean function
Browse files Browse the repository at this point in the history
  • Loading branch information
42atomys committed May 8, 2024
1 parent 715e6fa commit 8e286dc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions filesystem_functions_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ func TestOsExt(t *testing.T) {
runTestCases(t, tests)
}

func TestOsClean(t *testing.T) {
var tests = testCases{
{"TestEmptyPath", `{{ osClean "" }}`, ".", nil},
{"TestRootPath", `{{ osClean "/" }}`, "/", nil},
{"TestWithoutExtension", `{{ osClean "/path///to/file" }}`, "/path/to/file", nil},
}

runTestCases(t, tests)
}

func TestOsIsAbs(t *testing.T) {
var tests = testCases{
{"TestEmptyPath", `{{ osIsAbs "" }}`, "false", nil},
Expand Down
10 changes: 10 additions & 0 deletions filesystem_functions_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ func TestOsExt(t *testing.T) {
runTestCases(t, tests)
}

func TestOsClean(t *testing.T) {
var tests = testCases{
{"TestEmptyPath", `{{ osClean "" }}`, ".", nil},
{"TestRootPath", `{{ osClean "D:\\" }}`, "D:\\", nil},
{"TestWithoutExtension", `{{ osClean "D:\\path\\\\to\\file" }}`, "D:\\path\\to\\file", nil},
}

runTestCases(t, tests)
}

func TestOsIsAbs(t *testing.T) {
var tests = testCases{
{"TestEmptyPath", `{{ osIsAbs "" }}`, "false", nil},
Expand Down

0 comments on commit 8e286dc

Please sign in to comment.