Skip to content

Commit

Permalink
fix: testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
jinoosss committed Nov 26, 2024
1 parent 4b84fd2 commit 71816b1
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions serve/methods/gas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,22 @@ func TestGetGasPricesByTxResults_Transactions(t *testing.T) {
assert.Nil(t, err)
require.NotNil(t, response)

for index, responseItem := range response {
assert.Equal(t, responseItem.Denom, testCase.results[index].Denom)
assert.Equal(t, responseItem.High, testCase.results[index].High)
assert.Equal(t, responseItem.Average, testCase.results[index].Average)
assert.Equal(t, responseItem.Low, testCase.results[index].Low)
count := 0

for _, responseItem := range response {
for _, testCaseResult := range testCase.results {
if responseItem.Denom == testCaseResult.Denom {

Check failure on line 120 in serve/methods/gas_test.go

View workflow job for this annotation

GitHub Actions / Go Linter / lint

nestingReduce: invert if cond, replace body with `continue`, move old body after the statement (gocritic)
assert.Equal(t, responseItem.Denom, testCaseResult.Denom)
assert.Equal(t, responseItem.High, testCaseResult.High)
assert.Equal(t, responseItem.Average, testCaseResult.Average)
assert.Equal(t, responseItem.Low, testCaseResult.Low)

count++
}
}
}

assert.Equal(t, count, len(testCase.results))
})
}
}

0 comments on commit 71816b1

Please sign in to comment.