@@ -50,6 +50,15 @@ func TestExtractVariables(t *testing.T) {
5050 "bar" : {Name : "bar" },
5151 },
5252 },
53+ {
54+ name : "variable-without-curly-braces-and-with-number-suffix" ,
55+ dict : map [string ]interface {}{
56+ "foo" : "$bar_1" ,
57+ },
58+ expected : map [string ]Variable {
59+ "bar_1" : {Name : "bar_1" },
60+ },
61+ },
5362 {
5463 name : "variable" ,
5564 dict : map [string ]interface {}{
@@ -68,6 +77,15 @@ func TestExtractVariables(t *testing.T) {
6877 "bar" : {Name : "bar" , DefaultValue : "" , Required : true },
6978 },
7079 },
80+ {
81+ name : "required-variable-with-number-suffix" ,
82+ dict : map [string ]interface {}{
83+ "foo" : "${bar_1?:foo}" ,
84+ },
85+ expected : map [string ]Variable {
86+ "bar_1" : {Name : "bar_1" , DefaultValue : "" , Required : true },
87+ },
88+ },
7189 {
7290 name : "required-variable2" ,
7391 dict : map [string ]interface {}{
@@ -95,6 +113,24 @@ func TestExtractVariables(t *testing.T) {
95113 "bar" : {Name : "bar" , DefaultValue : "foo" },
96114 },
97115 },
116+ {
117+ name : "default-variable-with-number-suffix" ,
118+ dict : map [string ]interface {}{
119+ "foo" : "${bar_1:-foo}" ,
120+ },
121+ expected : map [string ]Variable {
122+ "bar_1" : {Name : "bar_1" , DefaultValue : "foo" },
123+ },
124+ },
125+ {
126+ name : "default-variable2-with-number-suffix" ,
127+ dict : map [string ]interface {}{
128+ "foo" : "${bar_1-foo}" ,
129+ },
130+ expected : map [string ]Variable {
131+ "bar_1" : {Name : "bar_1" , DefaultValue : "foo" },
132+ },
133+ },
98134 {
99135 name : "multiple-values" ,
100136 dict : map [string ]interface {}{
0 commit comments