Skip to content

Commit

Permalink
test: add more negative testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrMatsko committed Jan 16, 2025
1 parent 8056f9b commit 8be4eb9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion api/dto/triggers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,19 @@ func TestTriggerValidation(t *testing.T) {
Expr: "(?!",
}),
},
caseDesc: "with bad regexp (incorrect use of '*')",
caseDesc: "with bad regexp '(?1'",
},
{
givenTargets: []string{"seriesByTag('name=other.metric','Env=Env1', 'App=Moira-API', 'ResCode=~(4**)')"},
expectedErrRsp: api.ErrInvalidRequestContent{
ValidationError: fmt.Errorf(
"bad regexp in tag 'ResCode': %w",
&syntax.Error{
Code: syntax.ErrInvalidRepeatOp,
Expr: "**",
}),
},
caseDesc: "with bad regexp '(4**)'",
},
}

Expand Down

0 comments on commit 8be4eb9

Please sign in to comment.