26 lines
586 B
Go
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"))
|
|
}
|