-
Notifications
You must be signed in to change notification settings - Fork 60
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 test suite #270
add marshal test suite #270
Conversation
54960db
to
00277be
Compare
marshal/tests/serialization/set.go
Outdated
for i := range s.Values { | ||
val := s.Values[i] |
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.
serialization.Set{ Data: []byte("\x00\x00"), Values: mod.IntoRef.Append("0"), }.Run("[0000]str", t, marshal, unmarshal)
In my opinion, it will be easier and clearer this way. And Set.Run function become easier and clearer.
Sure, let's do this then:
serialization.Set{
Data: []byte("\x00\x00"),
Values: mod.AddVariants([]interface{}{"0"}, mod.IntoRef),
}.Run("[0000]str", t, marshal, unmarshal)
Changes for serialization.Set was pushed, please check it for further work on the rest of the. |
03009cb
to
a714bd5
Compare
ce09797
to
61541a7
Compare
f7d0c24
to
8a452e2
Compare
b9e49c8
to
eda87c8
Compare
Please check it out, if everything is fine, I will squash the commits and continue working on |
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.
Bunch of small nit picks, last pack.
@sylwiaszunejko , can you please also take a look.
not related to the code, but please squash commits, so they are sets of distinctive changes not "resolve conversation" ones |
I unresolved two comments that I don't think were addressed, but maybe I am missing something there are a lot of changes |
7b4f030
to
bd403b5
Compare
I did it, divided by packages.
Fixed |
Thanks for addressing the comments! I would like you to fix the commit history a little bit, commits like "cleaning", "optimizing x", "simplify x" should not exist, squash them and make the first commits clean/optimal/simple etc. in the first place. Having such commits with fixes that could be incorporated into the original commits is not something we want to merge into our git history |
bd403b5
to
1a25436
Compare
Something like this? |
Right now, it's a single large commit. Ideally, it would be better to break it into smaller commits, but not in the way it was before, like "adding A" and then "optimizing part x of A." Instead, it should be more like "adding a" and then "adding b (not related to a)". For example, in this PR (#256), each commit focuses on adding or fixing one specific thing. If a commit is fixing something, it's from the master branch or was added before that PR, not something introduced in the same PR. Does that make sense? |
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.
Very last nits.
Let's also wait till @sylwiaszunejko approve it.
internal/tests/funcs/new.go
Outdated
@@ -0,0 +1,18 @@ | |||
package funcs |
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 move this code into utils
package.
marshal/tests/serialization/set.go
Outdated
BrokenMarshalTypes []interface{} | ||
BrokenUnmarshalTypes []interface{} |
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.
Last optimization,
BrokenMarshalTypes []interface{} | |
BrokenUnmarshalTypes []interface{} | |
BrokenMarshalTypes []reflect.Type | |
BrokenUnmarshalTypes []reflect.Type |
internal/tests/utils/utils.go
Outdated
return out.Interface() | ||
} | ||
|
||
func EqualTypes(in1, in2 interface{}) bool { |
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.
Since reflect.Type
is comparable, please replace it with reflect.TypeOf(val1) == reflect.TypeOf(val2)
1a25436
to
a938b58
Compare
In general, it makes sense.
|
I also agree that there is no reason to have it splitted into commits, even though it has 15 files, all of them a there to do exact one thing, which is in line with the commit message. |
@illia-li , please don't resolve conversations, answer in the thread instead. |
a938b58
to
f8c4271
Compare
We will continue working on the |
No, let's merge it in and continue on another PR. |
f8c4271
to
dc44e9d
Compare
Let`s merge 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.
@sylwiaszunejko , can you pleae take another look, i am ok with this PR.
@illia-li Thanks for your work! |
@illia-li Thanks you, sorry for being so picky |
No description provided.