-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(protocol): trailing credential data skipped
This fixes an issue where the trailing data in the credential parsing function would be ignored.
- Loading branch information
1 parent
5719110
commit e6c1318
Showing
3 changed files
with
68 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package protocol | ||
|
||
import ( | ||
"errors" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func AssertIsProtocolError(t *testing.T, err error, errType, errDetails, errInfo string) { | ||
var e *Error | ||
|
||
require.True(t, errors.As(err, &e)) | ||
|
||
assert.Equal(t, errType, e.Type) | ||
assert.Equal(t, errDetails, e.Details) | ||
assert.Equal(t, errInfo, e.DevInfo) | ||
} |