@@ -7,9 +7,11 @@ import (
77 "context"
88 "testing"
99
10- "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator "
10+ "github.com/google/go-cmp/cmp "
1111 "github.com/hashicorp/terraform-plugin-framework/schema/validator"
1212 "github.com/hashicorp/terraform-plugin-framework/types"
13+
14+ "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
1315)
1416
1517func TestNoneOfCaseInsensitiveValidator (t * testing.T ) {
@@ -93,3 +95,34 @@ func TestNoneOfCaseInsensitiveValidator(t *testing.T) {
9395 })
9496 }
9597}
98+
99+ func TestNoneOfCaseInsensitiveValidator_Description (t * testing.T ) {
100+ t .Parallel ()
101+
102+ type testCase struct {
103+ in []string
104+ expected string
105+ }
106+
107+ testCases := map [string ]testCase {
108+ "quoted-once" : {
109+ in : []string {"foo" , "bar" , "baz" },
110+ expected : `value must be none of: ["foo" "bar" "baz"]` ,
111+ },
112+ }
113+
114+ for name , test := range testCases {
115+ name , test := name , test
116+ t .Run (name , func (t * testing.T ) {
117+ t .Parallel ()
118+
119+ v := stringvalidator .NoneOfCaseInsensitive (test .in ... )
120+
121+ got := v .MarkdownDescription (context .Background ())
122+
123+ if diff := cmp .Diff (got , test .expected ); diff != "" {
124+ t .Errorf ("unexpected difference: %s" , diff )
125+ }
126+ })
127+ }
128+ }
0 commit comments