From 4286793b0cde24a56e5d9459e54af8e290be9028 Mon Sep 17 00:00:00 2001 From: Denis Limarev Date: Thu, 6 Jan 2022 22:30:33 +0300 Subject: [PATCH] checkers: add few lines test cases for deprecatedComment (#1189) --- .../deprecatedComment/negative_tests.go | 23 +++++++++++++++++ .../deprecatedComment/positive_tests.go | 25 +++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/checkers/testdata/deprecatedComment/negative_tests.go b/checkers/testdata/deprecatedComment/negative_tests.go index d0f311c9c..41989223e 100644 --- a/checkers/testdata/deprecatedComment/negative_tests.go +++ b/checkers/testdata/deprecatedComment/negative_tests.go @@ -31,3 +31,26 @@ var ( // dePreca _ = 0 ) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ComponentStatus (and ComponentStatus) holds the cluster validation info. +// Deprecated: This API is deprecated in v1.19+ +type ComponentStatus struct { + foo string + // +optional + bar string + + // +optional + fooBard []string +} + +// ComponentStatusList represents the list of component statuses +// Deprecated: This API is deprecated in v1.19+ +type ComponentStatusList struct { + string + // +optional + int + + Items []ComponentStatus +} diff --git a/checkers/testdata/deprecatedComment/positive_tests.go b/checkers/testdata/deprecatedComment/positive_tests.go index e5a31433d..28d77ead5 100644 --- a/checkers/testdata/deprecatedComment/positive_tests.go +++ b/checkers/testdata/deprecatedComment/positive_tests.go @@ -181,3 +181,28 @@ type foo3 string /*! the proper format is `Deprecated: ` */ // deprecated in 1.11: use f instead. type foo4 string + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ComponentStatusBad (and ComponentStatusList) holds the cluster validation info. +/*! use `Deprecated: ` (note the casing) instead of `DeprecaTEd: ` */ +// DeprecaTEd: This API is deprecated in v1.19+ +type ComponentStatusBad struct { + foo string + // +optional + bar string + + // +optional + fooBard []string +} + +// ComponentStatusList represents the list of component statuses +/*! use `Deprecated: ` (note the casing) instead of `DeprecaTed: ` */ +// DeprecaTed: This API is deprecated in v1.19+ +type ComponentStatusListBad struct { + string + // +optional + int + + Items []int +}