Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Commit

Permalink
Fix Go 1.14 Error Message Changes (prebid#1271)
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxNode authored Apr 24, 2020
1 parent b61e259 commit f1d52fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
19 changes: 10 additions & 9 deletions adapters/sharethrough/butler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ package sharethrough

import (
"fmt"
"github.com/mxmCherry/openrtb"
"github.com/prebid/prebid-server/adapters"
"github.com/prebid/prebid-server/errortypes"
"github.com/prebid/prebid-server/openrtb_ext"
"github.com/stretchr/testify/assert"
"net/http"
"regexp"
"strconv"
"strings"
"testing"
"time"

"github.com/mxmCherry/openrtb"
"github.com/prebid/prebid-server/adapters"
"github.com/prebid/prebid-server/errortypes"
"github.com/prebid/prebid-server/openrtb_ext"
"github.com/stretchr/testify/assert"
)

type MockUtil struct {
Expand Down Expand Up @@ -538,15 +539,15 @@ func TestFailParseUri(t *testing.T) {
}{
"Fails decoding if unable to parse URI": {
input: "test:/#$%?#",
expectedError: `parse test:/#$%?#: invalid URL escape "%?#"`,
expectedError: `parse (\")?test:/#\$%\?#(\")?: invalid URL escape \"%\?#\"`,
},
"Fails decoding if height not provided": {
input: "http://abc.com?width=10",
expectedError: `strconv.ParseUint: parsing "": invalid syntax`,
expectedError: `strconv.ParseUint: parsing \"\": invalid syntax`,
},
"Fails decoding if width not provided": {
input: "http://abc.com?height=10",
expectedError: `strconv.ParseUint: parsing "": invalid syntax`,
expectedError: `strconv.ParseUint: parsing \"\": invalid syntax`,
},
}

Expand All @@ -559,6 +560,6 @@ func TestFailParseUri(t *testing.T) {

assert.Nil(output)
assert.NotNil(actualError)
assert.Equal(test.expectedError, actualError.Error())
assert.Regexp(test.expectedError, actualError.Error())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

"expectedMakeRequestsErrors": [
{
"value": "Malformed URL: parse https://example.ho%st.tappx.com: invalid URL escape \"%st\"",
"comparison": "literal"
"value": "Malformed URL: parse (\\\")?https://example\\.ho%st\\.tappx.com(\\\")?: invalid URL escape \\\"%st\\\"",
"comparison": "regex"
}
]

Expand Down

0 comments on commit f1d52fa

Please sign in to comment.