File: kubernetes-resources_test.go

package info (click to toggle)
kubernetes-split-yaml 0.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 372 kB
  • sloc: sh: 79; makefile: 14
file content (26 lines) | stat: -rw-r--r-- 515 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package main

import (
	"fmt"
	"testing"
)

func Test_getShortName(t *testing.T) {
	tests := []struct {
		name string
		have string
		want string
	}{
		{have: "ServiceAccount", want: "sa"},
		{have: "horizontalpodautoscaler", want: "hpa"},
		{have: "Pod", want: "pod"},
	}
	for _, tt := range tests {
		name := fmt.Sprintf("%s -> %s", tt.have, tt.want)
		t.Run(name, func(t *testing.T) {
			if got := getShortName(tt.have); got != tt.want {
				t.Errorf("getShortName() = %v, want %v", got, tt.want)
			}
		})
	}
}