Skip to content

Commit

Permalink
updating regexps
Browse files Browse the repository at this point in the history
  • Loading branch information
haitchison committed Dec 20, 2023
1 parent ad6055f commit 9768b56
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/lambda_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ func TestLambdaCreation(t *testing.T) {

checkSubnetId := terraform.Output(t, terraformOptions, "subnet_ids")
checkSecurityGroupId := terraform.Output(t, terraformOptions, "security_group_ids")

re := regexp.MustCompile(`[{}\[\]\s]`)
SubnetId = re.ReplaceAllString(checkSubnetId, "")
SecurityGroupId = re.ReplaceAllString(checkSecurityGroupId, "")
subnetId = re.ReplaceAllString(checkSubnetId, "")
securityGroupId = re.ReplaceAllString(checkSecurityGroupId, "")

assert.Regexp(t, regexp.MustCompile(`^instance-scheduler-lambda-function*`), functionName)
assert.Regexp(t, regexp.MustCompile(`^200*`), resultCode)

assert.Regexp(t, regexp.MustCompile(`^subnet-\w+$`), SubnetId)
assert.Regexp(t, regexp.MustCompile(`^sg-\d+$`), SecurityGroupId)
assert.Regexp(t, regexp.MustCompile(`^subnet-\w+$`), subnetId)
assert.Regexp(t, regexp.MustCompile(`^sg-\d+$`), securityGroupId)
}

0 comments on commit 9768b56

Please sign in to comment.