Skip to content

Add comprehensive ConvertTo-Json depth and multilevel composition tests#26744

Merged
daxian-dbw merged 3 commits intoPowerShell:masterfrom
yotsuda:add-convertto-json-depth-multilevel-tests
Feb 10, 2026
Merged

Add comprehensive ConvertTo-Json depth and multilevel composition tests#26744
daxian-dbw merged 3 commits intoPowerShell:masterfrom
yotsuda:add-convertto-json-depth-multilevel-tests

Conversation

@yotsuda
Copy link
Contributor

@yotsuda yotsuda commented Feb 3, 2026

PR Summary

Add comprehensive depth truncation and multilevel composition tests for ConvertTo-Json (Phase 4).

PR Context

This is a follow-up to #26639. Per @iSazonov's suggestion, comprehensive tests are being submitted as separate PRs for each phase.

PR Checklist

Tests Added

The following depth truncation and multilevel composition tests are added to ConvertTo-Json.Tests.ps1:

Context Tests Description
Depth parameter basic behavior 5 default depth, explicit depth 0/1/10/100
Depth truncation with arrays 3 nested arrays, array of objects at depth limit
Depth truncation with hashtables 3 nested hashtables, ordered dictionaries
Depth truncation string representation 3 PSCustomObject, array, mixed types at Depth 0
Multilevel: Array containing Dictionary 3 array of hashtables, ordered dicts, nested arrays
Multilevel: Dictionary containing Array 3 hashtable with arrays, nested arrays, array of dicts
Multilevel: PSCustomObject with mixed types 4 arrays, hashtables, nested PSCustomObjects
Multilevel: PowerShell class in structures 3 class with arrays, in hashtables, mixed compositions
Complex multilevel compositions 4 3-level mixed, deeply nested, sufficient/limited depth
Pipeline vs InputObject 3 array, nested structure serialization consistency

Total: 34 new tests

@yotsuda yotsuda requested a review from a team as a code owner February 3, 2026 14:50
@iSazonov
Copy link
Collaborator

iSazonov commented Feb 6, 2026

@yotsuda Please resolve merge conflict. In other PR too.

@yotsuda yotsuda force-pushed the add-convertto-json-depth-multilevel-tests branch from daaec64 to f2a4a2e Compare February 6, 2026 06:07
@yotsuda
Copy link
Contributor Author

yotsuda commented Feb 6, 2026

@iSazonov Thank you for letting me know. I have rebased both PRs onto the latest master to resolve the merge conflicts.

@iSazonov iSazonov added the CL-Test Indicates that a PR should be marked as a test change in the Change Log label Feb 6, 2026
yotsuda added a commit to yotsuda/PowerShell that referenced this pull request Feb 6, 2026
@iSazonov iSazonov added the Approved-LowRisk Indicate a PR has been approved and can be merged after a quick review of another maintainer. label Feb 6, 2026
@daxian-dbw
Copy link
Member

@yotsuda and @iSazonov Same here, please resolve the conflict. Thanks!

@iSazonov
Copy link
Collaborator

iSazonov commented Feb 6, 2026

@yotsuda Please resolve merge conflicts.

yotsuda and others added 3 commits February 7, 2026 08:42
…o-Json

Add 34 new Pester tests covering:
- Depth parameter basic behavior (default and explicit depth values)
- Depth truncation with arrays and hashtables
- Depth truncation string representations
- Multilevel compositions (Array/Dictionary/PSCustomObject/Class)
- Complex nested mixed type structures
- Pipeline vs InputObject behavior

This is Phase 4 of the test plan from PR PowerShell#26639.

Co-Authored-By: Claude <[email protected]>
- Add truncation test for PowerShell class at Depth limit
- Update all Phase 4 tests to verify both Pipeline and InputObject
- Remove dedicated Pipeline vs InputObject Context

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@yotsuda yotsuda force-pushed the add-convertto-json-depth-multilevel-tests branch from 13c77c8 to e9b1545 Compare February 7, 2026 00:19
@yotsuda
Copy link
Contributor Author

yotsuda commented Feb 7, 2026

@daxian-dbw @iSazonov Thanks!!
Rebased onto the latest master. Merge conflicts resolved.

@daxian-dbw daxian-dbw merged commit 664ac75 into PowerShell:master Feb 10, 2026
36 checks passed
@yotsuda yotsuda deleted the add-convertto-json-depth-multilevel-tests branch February 10, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved-LowRisk Indicate a PR has been approved and can be merged after a quick review of another maintainer. CL-Test Indicates that a PR should be marked as a test change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants