1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-17 05:00:27 +00:00
kyverno/cmd/cli/kubectl-kyverno/output/table/printer_test.go
Charles-Edouard Brétéché 0b33ae2b06
refactor: cli packages structure ()
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-05 08:55:01 +00:00

42 lines
675 B
Go

package table
import (
"testing"
)
func TestNewTablePrinter(t *testing.T) {
if got := NewTablePrinter(); got == nil {
t.Errorf("NewTablePrinter() return nill")
}
}
func Test_rowsLength(t *testing.T) {
tests := []struct {
name string
length int
want bool
}{{
name: "0",
length: 0,
want: false,
}, {
name: "10",
length: 10,
want: false,
}, {
name: "11",
length: 11,
want: true,
}, {
name: "20",
length: 20,
want: true,
}}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := rowsLength(tt.length); got != tt.want {
t.Errorf("rowsLength() = %v, want %v", got, tt.want)
}
})
}
}