Skip to content

Commit

Permalink
extended tests to include hyphen checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenrinzema committed Jun 19, 2020
1 parent 1987468 commit 64bf946
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pkg/specs/template/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func TestGetTemplateContent(t *testing.T) {
"{{ input:message}}": "input:message",
"{{input:message}}": "input:message",
"{{ add(input:message) }}": "add(input:message)",
"{{ add(input:user-id) }}": "add(input:user-id)",
}

for input, expected := range tests {
Expand All @@ -65,6 +66,14 @@ func TestParseReference(t *testing.T) {
Path: "message",
},
},
"input:user-id": {
Name: name,
Path: path,
Reference: &specs.PropertyReference{
Resource: "input",
Path: "user-id",
},
},
"input:": {
Path: path,
Reference: &specs.PropertyReference{
Expand Down Expand Up @@ -108,6 +117,20 @@ func TestParseTemplate(t *testing.T) {
Path: "message",
},
},
"{{ input.prop:user-id }}": {
Path: "message",
Reference: &specs.PropertyReference{
Resource: "input.prop",
Path: "user-id",
},
},
"{{ input:user-id }}": {
Path: "message",
Reference: &specs.PropertyReference{
Resource: "input",
Path: "user-id",
},
},
"{{ input.prop:message.prop }}": {
Path: "message.prop",
Reference: &specs.PropertyReference{
Expand Down

0 comments on commit 64bf946

Please sign in to comment.