mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Replace bash release helper scripts with Go progam
This commit is contained in:
32
cmd/gorepomod/internal/edit/editor_test.go
Normal file
32
cmd/gorepomod/internal/edit/editor_test.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package edit
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestUpstairs(t *testing.T) {
|
||||
var testCases = map[string]struct {
|
||||
depth int
|
||||
expected string
|
||||
}{
|
||||
"zero": {
|
||||
depth: 0,
|
||||
expected: "",
|
||||
},
|
||||
"one": {
|
||||
depth: 1,
|
||||
expected: "../",
|
||||
},
|
||||
"five": {
|
||||
depth: 5,
|
||||
expected: "../../../../../",
|
||||
},
|
||||
}
|
||||
for n, tc := range testCases {
|
||||
if tc.expected != upstairs(tc.depth) {
|
||||
t.Fatalf(
|
||||
"%s: for depth %d, expected %q, got %q",
|
||||
n, tc.depth, tc.expected, upstairs(tc.depth))
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user