mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-29 09:40:49 +00:00
38 lines
714 B
Go
38 lines
714 B
Go
// Copyright 2019 The Kubernetes Authors.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package types_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
. "sigs.k8s.io/kustomize/v3/types"
|
|
)
|
|
|
|
func TestGenArgs_String(t *testing.T) {
|
|
tests := []struct {
|
|
ga *GenArgs
|
|
expected string
|
|
}{
|
|
{
|
|
ga: nil,
|
|
expected: "{nilGenArgs}",
|
|
},
|
|
{
|
|
ga: &GenArgs{},
|
|
expected: "{nsfx:false,beh:unspecified}",
|
|
},
|
|
{
|
|
ga: NewGenArgs(
|
|
&GeneratorArgs{Behavior: "merge"},
|
|
&GeneratorOptions{DisableNameSuffixHash: false}),
|
|
expected: "{nsfx:true,beh:merge}",
|
|
},
|
|
}
|
|
for _, test := range tests {
|
|
if test.ga.String() != test.expected {
|
|
t.Fatalf("Expected '%s', got '%s'", test.expected, test.ga.String())
|
|
}
|
|
}
|
|
}
|