mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-28 04:02:21 -04:00
Address feedback
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
This commit is contained in:
parent
2cf2bf5b8f
commit
e57512acfc
1 changed files with 3 additions and 3 deletions
|
|
@ -104,7 +104,7 @@ func TestCalculateDuration(t *testing.T) {
|
|||
expr parser.Expr
|
||||
expected time.Duration
|
||||
errorMessage string
|
||||
requirePositive bool
|
||||
allowedNegative bool
|
||||
}{
|
||||
{
|
||||
name: "addition",
|
||||
|
|
@ -193,7 +193,7 @@ func TestCalculateDuration(t *testing.T) {
|
|||
Op: parser.SUB,
|
||||
},
|
||||
expected: -5 * time.Second,
|
||||
requirePositive: true,
|
||||
allowedNegative: true,
|
||||
},
|
||||
{
|
||||
name: "division by zero",
|
||||
|
|
@ -225,7 +225,7 @@ func TestCalculateDuration(t *testing.T) {
|
|||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result, err := calculateDuration(tt.expr, tt.requirePositive)
|
||||
result, err := calculateDuration(tt.expr, tt.allowedNegative)
|
||||
if tt.errorMessage != "" {
|
||||
require.Error(t, err)
|
||||
require.Contains(t, err.Error(), tt.errorMessage)
|
||||
|
|
|
|||
Loading…
Reference in a new issue