moved a subset of source file to the kern package
This commit is contained in:
@@ -11,6 +11,8 @@ import (
|
||||
"os/user"
|
||||
"path"
|
||||
"testing"
|
||||
|
||||
"git.portale-stac.it/go-pkg/expr/kern"
|
||||
)
|
||||
|
||||
func TestExpandPathRootOk(t *testing.T) {
|
||||
@@ -19,7 +21,7 @@ func TestExpandPathRootOk(t *testing.T) {
|
||||
// wantErr := errors.New(`test expected string, got list ([])`)
|
||||
wantErr := error(nil)
|
||||
|
||||
gotValue, gotErr := ExpandPath(source)
|
||||
gotValue, gotErr := kern.ExpandPath(source)
|
||||
|
||||
if gotErr != nil && gotErr.Error() != wantErr.Error() {
|
||||
t.Errorf(`ExpandPath(%v) gotValue=%q, gotErr=%v -> wantValue=%q, wantErr=%v`,
|
||||
@@ -36,7 +38,7 @@ func TestExpandPathRootSubDirOk(t *testing.T) {
|
||||
// wantErr := errors.New(`test expected string, got list ([])`)
|
||||
wantErr := error(nil)
|
||||
|
||||
gotValue, gotErr := ExpandPath(source)
|
||||
gotValue, gotErr := kern.ExpandPath(source)
|
||||
|
||||
if gotErr != nil && gotErr.Error() != wantErr.Error() {
|
||||
t.Errorf(`ExpandPath(%v) gotValue=%q, gotErr=%v -> wantValue=%q, wantErr=%v`,
|
||||
@@ -54,7 +56,7 @@ func TestExpandPathUser(t *testing.T) {
|
||||
// wantErr := errors.New(`test expected string, got list ([])`)
|
||||
wantErr := error(nil)
|
||||
|
||||
gotValue, gotErr := ExpandPath(source)
|
||||
gotValue, gotErr := kern.ExpandPath(source)
|
||||
|
||||
if gotErr != nil {
|
||||
t.Errorf(`ExpandPath(%v) gotValue=%q, gotErr=%v -> wantValue=%q, wantErr=%v`,
|
||||
@@ -72,7 +74,7 @@ func TestExpandPathEnv(t *testing.T) {
|
||||
// wantErr := errors.New(`test expected string, got list ([])`)
|
||||
wantErr := error(nil)
|
||||
|
||||
gotValue, gotErr := ExpandPath(source)
|
||||
gotValue, gotErr := kern.ExpandPath(source)
|
||||
|
||||
if gotErr != nil {
|
||||
t.Errorf(`ExpandPath(%v) gotValue=%q, gotErr=%v -> wantValue=%q, wantErr=%v`,
|
||||
@@ -88,7 +90,7 @@ func TestExpandPathErr(t *testing.T) {
|
||||
wantValue := "~fake-user/test"
|
||||
wantErr := errors.New(`user: unknown user fake-user`)
|
||||
|
||||
gotValue, gotErr := ExpandPath(source)
|
||||
gotValue, gotErr := kern.ExpandPath(source)
|
||||
|
||||
if gotErr != nil && gotErr.Error() != wantErr.Error() {
|
||||
t.Errorf(`ExpandPath(%v) gotValue=%q, gotErr=%v -> wantValue=%q, wantErr=%v`,
|
||||
@@ -106,7 +108,7 @@ func TestExpandPathUserErr(t *testing.T) {
|
||||
// wantErr := errors.New(`test expected string, got list ([])`)
|
||||
wantErr := error(nil)
|
||||
|
||||
gotValue, gotErr := ExpandPath(source)
|
||||
gotValue, gotErr := kern.ExpandPath(source)
|
||||
|
||||
if gotErr != nil {
|
||||
t.Errorf(`ExpandPath(%v) gotValue=%q, gotErr=%v -> wantValue=%q, wantErr=%v`,
|
||||
|
||||
Reference in New Issue
Block a user