Add comprehensive PSCustomObject tests for ConvertTo-Json#26743
Open
yotsuda wants to merge 2 commits intoPowerShell:masterfrom
Open
Add comprehensive PSCustomObject tests for ConvertTo-Json#26743yotsuda wants to merge 2 commits intoPowerShell:masterfrom
yotsuda wants to merge 2 commits intoPowerShell:masterfrom
Conversation
05f4e31 to
852aca0
Compare
6 tasks
iSazonov
reviewed
Feb 10, 2026
Collaborator
iSazonov
left a comment
There was a problem hiding this comment.
@yotsuda Please resolve merge conflicts.
Not all tests follow "via Pipeline and InputObject" pattern.
I'd move tests for PowerShell classes in another PR since we need more tests. I don't see tests with array and dictionary fields at least.
852aca0 to
a781f41
Compare
Contributor
Author
|
Thank you for the review, @iSazonov! I've addressed all your feedback:
All 22 PSCustomObject tests pass. (a781f41) |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new “Phase 3” test block to expand ConvertTo-Json coverage for PSCustomObject serialization scenarios in the PowerShell Utility module tests.
Changes:
- Add comprehensive
PSCustomObjectserialization tests (basic, type coverage, nesting/depth, ETS properties). - Add array-focused
PSCustomObjecttests including-AsArraybehavior.
test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Json.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Json.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Json.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Json.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Json.Tests.ps1
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Json.Tests.ps1
Show resolved
Hide resolved
iSazonov
reviewed
Feb 10, 2026
test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Json.Tests.ps1
Show resolved
Hide resolved
6 tasks
iSazonov
approved these changes
Feb 10, 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.
PR Summary
Add comprehensive PSCustomObject tests for
ConvertTo-Json(Phase 3).PR Context
This is a follow-up to #26742. Per @iSazonov's suggestion in #26639, comprehensive tests are being submitted as separate PRs for each phase.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerTests Added
The following PSCustomObject tests are added to
ConvertTo-Json.Tests.ps1:Total: 21 new tests