-
Notifications
You must be signed in to change notification settings - Fork 621
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
limayaml/defaults_test.go
: use slices.Clone()
to create expect
variable
#2587
Conversation
f20b11f
to
128a1b0
Compare
…riable to avoid input variable were changed on preparing `expect` variable. Signed-off-by: Norio Nomura <norio.nomura@gmail.com> limayaml: revert fixing expect Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
The test was passing regardless of what value was assigned to `Script` because `expect.Probes[0]` and `y.Probes[0]` were the same instance. Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
…ueueSize` `expect.Mounts[0]` was the same instance as each of `y.Mounts[0]` and `d.Mounts[0]`, so the test passed regardless of the value set for `Virtiofs.QueueSize`. The default for `Virtiofs.QueueSize` is `nil`, but I'll keep the code that explicitly sets it to `nil` to make it clear that `nil` is expected. Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
Because `d` is no longer modified to expected values, it needs to keep `dExpect` to creating `expect` variable later. Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
128a1b0
to
621ee4c
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.
Thanks, LGTM
Thanks! 🙏🏻 |
This is so much nicer like this! every change has a clear commit message explaining the change and if we need to revert a change it can be a simple revert of single commit. Regrading the actual it seems that if we need to clone so many things, we can simplify by deep copying the entire struct. |
to avoid input variable were changed on preparing
expect
variable.Also fixes some tests that passed unexpectedly because input variable was changed.