Skip to content

Commit

Permalink
generators: Simplify backtick escape in test
Browse files Browse the repository at this point in the history
  • Loading branch information
apelisse committed Jun 12, 2023
1 parent 725288a commit 3e8f62f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/generators/openapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1632,10 +1632,10 @@ const EnumB EnumType = "b"
// +k8s:openapi-gen=true
// +k8s:openapi-gen=x-kubernetes-type-tag:type_test
type Blah struct {
// Value is the value.
// Value is the value.
Value EnumType
NoCommentEnum EnumType
// +optional
// +optional
OptionalEnum *EnumType
}`)
if callErr != nil {
Expand All @@ -1653,26 +1653,26 @@ Description: "Blah is a test.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"Value": {
SchemaProps: spec.SchemaProps{`+"\n"+
"Description: \"Value is the value.\\n\\nPossible enum values:\\n - `\\\"a\\\"` is a.\\n - `\\\"b\\\"` is b.\","+`
SchemaProps: spec.SchemaProps{
Description: "Value is the value.\n\nPossible enum values:\n - `+"`"+`\"a\"`+"`"+` is a.\n - `+"`"+`\"b\"`+"`"+` is b.",
Default: "",
Type: []string{"string"},
Format: "",
Enum: []interface{}{"a", "b"},
},
},
"NoCommentEnum": {
SchemaProps: spec.SchemaProps{`+"\n"+
"Description: \"Possible enum values:\\n - `\\\"a\\\"` is a.\\n - `\\\"b\\\"` is b.\","+`
SchemaProps: spec.SchemaProps{
Description: "Possible enum values:\n - `+"`"+`\"a\"`+"`"+` is a.\n - `+"`"+`\"b\"`+"`"+` is b.",
Default: "",
Type: []string{"string"},
Format: "",
Enum: []interface{}{"a", "b"},
},
},
"OptionalEnum": {
SchemaProps: spec.SchemaProps{`+"\n"+
"Description: \"Possible enum values:\\n - `\\\"a\\\"` is a.\\n - `\\\"b\\\"` is b.\","+`
SchemaProps: spec.SchemaProps{
Description: "Possible enum values:\n - `+"`"+`\"a\"`+"`"+` is a.\n - `+"`"+`\"b\"`+"`"+` is b.",
Type: []string{"string"},
Format: "",
Enum: []interface{}{"a", "b"},
Expand Down

0 comments on commit 3e8f62f

Please sign in to comment.