Files
server/tests/unit/support_test.go
T
2026-01-16 15:49:34 +08:00

26 lines
586 B
Go

//go:build linux
// +build linux
package unit
import (
"fmt"
"strings"
"testing"
"github.com/goravel/framework/support/path"
"github.com/stretchr/testify/assert"
)
func TestPathResource(t *testing.T) {
resourcePath := path.Resource()
fmt.Println(resourcePath)
assert.True(t, strings.HasPrefix(resourcePath, "/"))
assert.True(t, strings.HasSuffix(resourcePath, "/resources"))
resourcePath = path.Resource("test.txt")
fmt.Println(resourcePath)
assert.True(t, strings.HasPrefix(resourcePath, "/"))
assert.True(t, strings.HasSuffix(resourcePath, "/resources/test.txt"))
}