program: Improve program tests#64
Merged
Merged
Conversation
joncinque
previously approved these changes
May 19, 2026
Contributor
joncinque
left a comment
There was a problem hiding this comment.
Looks good to me! I mostly looked at the instructions and post-conditions of the tests, because there was really a lot here.
Just a nit on the instruction creators, but that can be addressed separately.
| program: Option<&Pubkey>, | ||
| program_data: Option<&Pubkey>, | ||
| destination: &Pubkey, | ||
| ) -> Result<Instruction, ProgramError> { |
Contributor
There was a problem hiding this comment.
nit: Do any of these need return a Result? I don't see the error ever being used
Contributor
Author
There was a problem hiding this comment.
Good point, they don't need to return a Result. Changed in 0e3f384
joncinque
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Currently the program tests (mollusk) do not test all instructions.
Solution
Add tests for all instructions.
While adding the tests, two small tweaks were done:
SetDatainstruction data.