From 9b3296be793243082ea1828400a308b137c16ead Mon Sep 17 00:00:00 2001 From: Alexander Bezobchuk Date: Mon, 17 Feb 2020 14:46:48 +0100 Subject: [PATCH] Merge PR #5655: Fix TestParseHTTPArgs --- types/rest/rest_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/types/rest/rest_test.go b/types/rest/rest_test.go index e23766cdd342..6088569c8f09 100644 --- a/types/rest/rest_test.go +++ b/types/rest/rest_test.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "net/http" "net/http/httptest" + "sort" "testing" "github.com/stretchr/testify/require" @@ -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 {