@@ -14,7 +14,7 @@ import (
1414 "github.com/hashicorp/terraform-provider-aws/internal/acctest"
1515)
1616
17- func TestUserAgentFunction_basic (t * testing.T ) {
17+ func TestUserAgentFunction_valid (t * testing.T ) {
1818 t .Parallel ()
1919
2020 resource .UnitTest (t , resource.TestCase {
@@ -29,18 +29,57 @@ func TestUserAgentFunction_basic(t *testing.T) {
2929 resource .TestCheckOutput ("test" , "test-module/0.0.1 (test comment)" ),
3030 ),
3131 },
32+ },
33+ })
34+ }
35+
36+ func TestUserAgentFunction_valid_name (t * testing.T ) {
37+ t .Parallel ()
38+
39+ resource .UnitTest (t , resource.TestCase {
40+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories ,
41+ TerraformVersionChecks : []tfversion.TerraformVersionCheck {
42+ tfversion .SkipBelow (version .Must (version .NewVersion ("1.8.0" ))),
43+ },
44+ Steps : []resource.TestStep {
3245 {
33- Config : testUserAgentFunctionConfig ("test-module" , "0.0.1 " , "" ),
46+ Config : testUserAgentFunctionConfig ("test-module" , "" , "" ),
3447 Check : resource .ComposeAggregateTestCheckFunc (
35- resource .TestCheckOutput ("test" , "test-module/0.0.1 " ),
48+ resource .TestCheckOutput ("test" , "test-module" ),
3649 ),
3750 },
51+ },
52+ })
53+ }
54+
55+ func TestUserAgentFunction_valid_nameVersion (t * testing.T ) {
56+ t .Parallel ()
57+
58+ resource .UnitTest (t , resource.TestCase {
59+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories ,
60+ TerraformVersionChecks : []tfversion.TerraformVersionCheck {
61+ tfversion .SkipBelow (version .Must (version .NewVersion ("1.8.0" ))),
62+ },
63+ Steps : []resource.TestStep {
3864 {
39- Config : testUserAgentFunctionConfig ("test-module" , "" , "" ),
65+ Config : testUserAgentFunctionConfig ("test-module" , "0.0.1 " , "" ),
4066 Check : resource .ComposeAggregateTestCheckFunc (
41- resource .TestCheckOutput ("test" , "test-module" ),
67+ resource .TestCheckOutput ("test" , "test-module/0.0.1 " ),
4268 ),
4369 },
70+ },
71+ })
72+ }
73+
74+ func TestUserAgentFunction_valid_nameComment (t * testing.T ) {
75+ t .Parallel ()
76+
77+ resource .UnitTest (t , resource.TestCase {
78+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories ,
79+ TerraformVersionChecks : []tfversion.TerraformVersionCheck {
80+ tfversion .SkipBelow (version .Must (version .NewVersion ("1.8.0" ))),
81+ },
82+ Steps : []resource.TestStep {
4483 {
4584 Config : testUserAgentFunctionConfig ("test-module" , "" , "test comment" ),
4685 Check : resource .ComposeAggregateTestCheckFunc (
@@ -51,7 +90,7 @@ func TestUserAgentFunction_basic(t *testing.T) {
5190 })
5291}
5392
54- func TestUserAgentFunction_missingName (t * testing.T ) {
93+ func TestUserAgentFunction_invalid (t * testing.T ) {
5594 t .Parallel ()
5695
5796 resource .UnitTest (t , resource.TestCase {
0 commit comments