Skip to content

Commit

Permalink
Merge PR #5655: Fix TestParseHTTPArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbez committed Mar 24, 2020
1 parent 94c2eb6 commit 5977753
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion types/rest/rest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io/ioutil"
"net/http"
"net/http/httptest"
"sort"
"testing"

"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -91,12 +92,15 @@ func TestParseHTTPArgs(t *testing.T) {
{"error limit 0", reqE2, httptest.NewRecorder(), []string{}, DefaultPage, DefaultLimit, true},

{"tags", req4, httptest.NewRecorder(), []string{"foo='faa'"}, DefaultPage, DefaultLimit, false},
{"tags", reqTxH, httptest.NewRecorder(), []string{"tx.height>=12", "tx.height<=14"}, DefaultPage, DefaultLimit, false},
{"tags", reqTxH, httptest.NewRecorder(), []string{"tx.height<=14", "tx.height>=12"}, DefaultPage, DefaultLimit, false},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
tags, page, limit, err := ParseHTTPArgs(tt.req)

sort.Strings(tags)

if tt.err {
require.NotNil(t, err)
} else {
Expand Down

0 comments on commit 5977753

Please sign in to comment.