-
Notifications
You must be signed in to change notification settings - Fork 57
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
add marshal corrupt test suite
#278
add marshal corrupt test suite
#278
Conversation
418ae94
to
b1a4ee3
Compare
4ecfdd1
to
68b4b03
Compare
4943365
to
45d7cf0
Compare
sorry for being so picky about commit messages but move all code to internal/tests/serialization is not the best name, |
45d7cf0
to
14bc33e
Compare
Is it better now? |
internal/tests/serialization/set.go
Outdated
} | ||
|
||
// RunCorruptTest runs tests for cases when the function should an error. | ||
func (s Set) RunCorruptTest(name string, t *testing.T, marshal func(interface{}) ([]byte, error), unmarshal func([]byte, interface{}) error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to avoid confusiton let's have another structure for these tests or, even split it into two (for negative serialization and deserialization tests), since you already logically split them:
Set
-> PositiveSerializationSet
NegativeMarshalSet
NetativeUnmarhsalSet
Feel free to suggest better names for them, or provide contr argument why we hsould not do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) It's more difficult than just writing code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
`serialization` and `utils` packages are joined and moved to `internal/tests/serialization`
14bc33e
to
6a1a6be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's wait for @sylwiaszunejko approve
Changes:
corrupt test suite
for testingmarshal
,unmarshal
functions.corrupt test
forsmallint
serialization
,utils
packages tointernal/tests/serialization