Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Go 1.14 Error Message Changes #1271

Merged
merged 1 commit into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was automatically changed via the VS Code formatter.

"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