-
Notifications
You must be signed in to change notification settings - Fork 671
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
[vms/avm] Replace strings.Replace
with fmt.Sprintf
in tests
#3177
Conversation
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.
Approving with a requested change that doesn't need re-review.
I think it's much better with these changes; next step, I'd suggest moving these large json structure into an external file and embed these doing buildtime. ( I wouldn't make this suggestion for few lines of json.. but these jsons are quite massive, and look like they might be changing regardless of the testing code ). |
Assuming use of |
These won't be changing at all. The reason the JSON is in the test code is to guarantee we don't make a change that accidentally changes a JSON serialization (which would impact downstream consumers, particularly in javascript land) |
I like the idea of keeping the JSON itself since Marshal versus Unmarshal could lead to an undesired change (serializing |
Why this should be merged
@ARR4N pointed out that we could use
fmt.Sprintf
with explicit arg indices for better readability during review of another PR (#3165 (comment))How this works
Replaces
strings.Replace
withfmt.Sprintf
in the avm tests (only place we do this pattern currently)How this was tested
CI