Expand test coverage for Sodium public commands - #73
Open
Marius Storhaug (MariusStorhaug) wants to merge 2 commits into
Open
Expand test coverage for Sodium public commands#73Marius Storhaug (MariusStorhaug) wants to merge 2 commits into
Marius Storhaug (MariusStorhaug) wants to merge 2 commits into
Conversation
- Add BeforeAll block to fail fast with a helpful message when the Sodium module is not loaded and no source manifest exists. - Cover parameter validation: null/empty Message, PublicKey, and PrivateKey. - Add Unicode/special-character round-trip and sealed-box non-determinism tests. - Add wrong-length base64 key rejection and mismatched public/private key tests. - Extend key-pair tests to verify output shape and randomness. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
No Significant Changes DetectedThis PR does not contain changes to files that would trigger a new release:
Build, test, and publish stages will be skipped for this PR. If you believe this is incorrect, please verify that your changes are in the correct locations. |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Marius Storhaug (MariusStorhaug)
marked this pull request as ready for review
August 3, 2026 01:01
Updates the reusable workflow pin from v6.1.13 to v6.1.16 to pick up the latest fixes and improvements. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
No Significant Changes DetectedThis PR does not contain changes to files that would trigger a new release:
Build, test, and publish stages will be skipped for this PR. If you believe this is incorrect, please verify that your changes are in the correct locations. |
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.
Summary
The existing Pester tests were a solid foundation (29 tests) but not yet production-level. This change expands coverage to 41 tests and adds a
BeforeAllsetup block so the test file fails fast with a helpful message when the module is not available.What changed
BeforeAllblock that importssrc\Sodium.psd1when the module is not already loaded, or throws a clear build-first message.ConvertTo-SodiumSealedBox,ConvertFrom-SodiumSealedBox, andGet-SodiumPublicKey.Test results
Notes / follow-up opportunities
ConvertTo-SodiumSealedBoxrejects empty strings becauseMessageis mandatory. If empty messages should be supported, the function needs[AllowEmptyString()].Get-SodiumPublicKey -AsByteArrayclaims to preserve the byte array as a single pipeline object via a unary comma, but piping it intoForEach-Objectstill enumerates the 32 bytes. This may warrant a separate code fix.examples/CreateGitHubSecret.ps1uses-Secret, but the actual parameter is-Message; the example is currently out of sync with the code.Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com