Skip to content

Commit 5ede483

Browse files
committed
fix test
1 parent 99a0a79 commit 5ede483

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

internal/config/types_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ func TestTypes_isAllowedDir(t *testing.T) {
7878
assert.Equal(t, test.allowed, result)
7979
})
8080
}
81+
}
8182

82-
t.Run("Test 7: Symlink in allowed directory", func(t *testing.T) {
83+
func TestTypes_isAllowedDirWithSymlink(t *testing.T) {
84+
t.Run("Test 1: Symlink in allowed directory is not allowed", func(t *testing.T) {
8385
allowedDirs := []string{"/etc/nginx"}
8486
filePath := "file.conf"
8587
symlinkPath := "file_link"
@@ -103,8 +105,7 @@ func TestTypes_isAllowedDir(t *testing.T) {
103105
require.NoError(t, err)
104106

105107
result, err := isAllowedDir(symlinkPath, allowedDirs)
106-
require.NoError(t, err)
107-
108+
require.Error(t, err)
108109
require.False(t, result, "Symlink in allowed directory should return false")
109110
})
110111
}

0 commit comments

Comments
 (0)