util files moved form kern to util package

This commit is contained in:
2026-04-29 11:03:36 +02:00
parent 4d910dd069
commit 8787973de0
20 changed files with 284 additions and 250 deletions
+7 -7
View File
@@ -12,7 +12,7 @@ import (
"path"
"testing"
"git.portale-stac.it/go-pkg/expr/kern"
"git.portale-stac.it/go-pkg/expr/util"
)
func TestExpandPathRootOk(t *testing.T) {
@@ -21,7 +21,7 @@ func TestExpandPathRootOk(t *testing.T) {
// wantErr := errors.New(`test expected string, got list ([])`)
wantErr := error(nil)
gotValue, gotErr := kern.ExpandPath(source)
gotValue, gotErr := util.ExpandPath(source)
if gotErr != nil && gotErr.Error() != wantErr.Error() {
t.Errorf(`ExpandPath(%v) gotValue=%q, gotErr=%v -> wantValue=%q, wantErr=%v`,
@@ -38,7 +38,7 @@ func TestExpandPathRootSubDirOk(t *testing.T) {
// wantErr := errors.New(`test expected string, got list ([])`)
wantErr := error(nil)
gotValue, gotErr := kern.ExpandPath(source)
gotValue, gotErr := util.ExpandPath(source)
if gotErr != nil && gotErr.Error() != wantErr.Error() {
t.Errorf(`ExpandPath(%v) gotValue=%q, gotErr=%v -> wantValue=%q, wantErr=%v`,
@@ -56,7 +56,7 @@ func TestExpandPathUser(t *testing.T) {
// wantErr := errors.New(`test expected string, got list ([])`)
wantErr := error(nil)
gotValue, gotErr := kern.ExpandPath(source)
gotValue, gotErr := util.ExpandPath(source)
if gotErr != nil {
t.Errorf(`ExpandPath(%v) gotValue=%q, gotErr=%v -> wantValue=%q, wantErr=%v`,
@@ -74,7 +74,7 @@ func TestExpandPathEnv(t *testing.T) {
// wantErr := errors.New(`test expected string, got list ([])`)
wantErr := error(nil)
gotValue, gotErr := kern.ExpandPath(source)
gotValue, gotErr := util.ExpandPath(source)
if gotErr != nil {
t.Errorf(`ExpandPath(%v) gotValue=%q, gotErr=%v -> wantValue=%q, wantErr=%v`,
@@ -90,7 +90,7 @@ func TestExpandPathErr(t *testing.T) {
wantValue := "~fake-user/test"
wantErr := errors.New(`user: unknown user fake-user`)
gotValue, gotErr := kern.ExpandPath(source)
gotValue, gotErr := util.ExpandPath(source)
if gotErr != nil && gotErr.Error() != wantErr.Error() {
t.Errorf(`ExpandPath(%v) gotValue=%q, gotErr=%v -> wantValue=%q, wantErr=%v`,
@@ -108,7 +108,7 @@ func TestExpandPathUserErr(t *testing.T) {
// wantErr := errors.New(`test expected string, got list ([])`)
wantErr := error(nil)
gotValue, gotErr := kern.ExpandPath(source)
gotValue, gotErr := util.ExpandPath(source)
if gotErr != nil {
t.Errorf(`ExpandPath(%v) gotValue=%q, gotErr=%v -> wantValue=%q, wantErr=%v`,