From 6911b9cf3042b25cb0a402c296fd4ad14a6612a7 Mon Sep 17 00:00:00 2001 From: Yann Hamon Date: Sun, 1 Nov 2020 23:29:50 +0100 Subject: [PATCH] Add another flags parsing test to validate all flags --- pkg/config/config_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 6a68efd..f9ef0d0 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -92,6 +92,23 @@ func TestFromFlags(t *testing.T) { Verbose: true, }, }, + { + []string{"-ignore-missing-schemas", "-kubernetes-version", "1.16.0", "-n", "2", "-output", "json", + "-schema-location", "folder", "-schema-location", "anotherfolder", "-skip", "kinda,kindb", "-strict", + "-summary", "-verbose", "file1", "file2"}, + Config{ + Files: []string{"file1", "file2"}, + IgnoreMissingSchemas: true, + KubernetesVersion: "1.16.0", + NumberOfWorkers: 2, + OutputFormat: "json", + SchemaLocations: []string{"folder", "anotherfolder"}, + SkipKinds: map[string]bool{"kinda": true, "kindb": true}, + Strict: true, + Summary: true, + Verbose: true, + }, + }, } for _, testCase := range testCases {