nginx-ui/internal/helper/directory_test.go
2024-05-02 12:49:01 +08:00

11 lines
282 B
Go

package helper
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestIsUnderDirectory(t *testing.T) {
assert.Equal(t, true, IsUnderDirectory("/etc/nginx/nginx.conf", "/etc/nginx"))
assert.Equal(t, false, IsUnderDirectory("../../root/nginx.conf", "/etc/nginx"))
}