opencompose
opencompose copied to clipboard
Issues with encoding_test.go
Hi,
There are some problems which I encountered while working with encoding_test.go, let's fix them. Let's keep separate commits/PR's for each one of them.
-
[ ] No comments, so checking which tests are testing what gets a bit confusing, e.g.
TestService_UnmarshalYAMLandTestDecoder_Decodeseem a bit overlapping at first sight -
[ ] In most of the
testsstructs, thename stringfield is missing, and it is very unclear on what is being tested -
[ ] The inputs and outputs are making the file crazy huge, let's put them in separate files for better readability
@containscafeine @pradeepto @kadel I am picking the second task from the list.
No comments, so checking which tests are testing what gets a bit confusing, e.g. TestService_UnmarshalYAML and TestDecoder_Decode seem a bit overlapping at first sight
They might seem like they are overlapping but that is ok they operate on different level. You can see what they are testing just from names.
TestDecoder_Decode tests Decode function on Decoder type (func (d *Decoder) Decode ...)
TestService_UnmarshalYAML tests UnmarshalYAML function on func Service type ( (s *Service) UnmarshalYAML ...)
I would say add name to the tests that are big with lot of metadata and take up more than a page. One liner tests are fine without name.