Skip to content

Commit

Permalink
checkers: add few lines test cases for deprecatedComment (#1189)
Browse files Browse the repository at this point in the history
  • Loading branch information
peakle committed Jan 6, 2022
1 parent 8a81465 commit 4286793
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
23 changes: 23 additions & 0 deletions checkers/testdata/deprecatedComment/negative_tests.go
Expand Up @@ -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
}
25 changes: 25 additions & 0 deletions checkers/testdata/deprecatedComment/positive_tests.go
Expand Up @@ -181,3 +181,28 @@ type foo3 string
/*! the proper format is `Deprecated: <text>` */
// 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
}

0 comments on commit 4286793

Please sign in to comment.