File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,34 @@ func TestParameter(t *testing.T) {
19
19
ExpectError * regexp.Regexp
20
20
Check func (state * terraform.ResourceState )
21
21
}{{
22
+ Name : "NumberValidation_Max" ,
23
+ Config : `
24
+ data "coder_parameter" "region" {
25
+ name = "Region"
26
+ type = "number"
27
+ default = 2
28
+ validation {
29
+ max = 9
30
+ }
31
+ }
32
+ ` ,
33
+ Check : func (state * terraform.ResourceState ) {
34
+ for key , expected := range map [string ]string {
35
+ "name" : "Region" ,
36
+ "type" : "number" ,
37
+ "validation.#" : "1" ,
38
+ "default" : "2" ,
39
+ "validation.0.max" : "9" ,
40
+ } {
41
+ require .Equal (t , expected , state .Primary .Attributes [key ])
42
<
7198
span class="diff-text-marker">+ }
43
+
44
+ _ , foundDisplayName := state .Primary .Attributes ["display_name" ]
45
+ require .False (t , foundDisplayName , "display_name = " + state .Primary .Attributes ["display_name" ])
46
+ _ , foundValidationMin := state .Primary .Attributes ["validation.0.min" ]
47
+ require .False (t , foundValidationMin , "validation.0.min = " + state .Primary .Attributes ["validation.0.min" ])
48
+ },
49
+ }, {
22
50
Name : "FieldsExist" ,
23
51
Config : `
24
52
data "coder_parameter" "region" {
You can’t perform that action at this time.
0 commit comments