mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-18 03:45:12 +00:00
27 lines
619 B
Go
27 lines
619 B
Go
// Copyright 2020 The Kubernetes Authors.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package compiler
|
|
|
|
import (
|
|
"path/filepath"
|
|
"strings"
|
|
"testing"
|
|
|
|
"sigs.k8s.io/kustomize/api/filesys"
|
|
)
|
|
|
|
func TestDeterminePluginSrcRoot(t *testing.T) {
|
|
actual, err := DeterminePluginSrcRoot(filesys.MakeFsOnDisk())
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
if !filepath.IsAbs(actual) {
|
|
t.Errorf("expected absolute path, but got '%s'", actual)
|
|
}
|
|
expectedSuffix := filepath.Join("sigs.k8s.io", "kustomize", "plugin")
|
|
if !strings.HasSuffix(actual, expectedSuffix) {
|
|
t.Errorf("expected suffix '%s' in '%s'", expectedSuffix, actual)
|
|
}
|
|
}
|