Skip to content

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

Merged
Dongbo Wang (daxian-dbw) merged 3 commits into
PowerShell:masterfrom
yotsuda:add-convertto-json-depth-multilevel-tests
Feb 10, 2026
Merged

Dongbo Wang (daxian-dbw) merged 3 commits into
PowerShell:masterfrom
yotsuda:add-convertto-json-depth-multilevel-tests

Conversation

@yotsuda

@yotsuda Yoshifumi (yotsuda) commented Feb 3, 2026 •

Copy link
Copy Markdown
Contributor

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 Ilya (@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
Yoshifumi (yotsuda) requested a review from a team as a code owner February 3, 2026 14:50
@iSazonov

Copy link
Copy Markdown
Collaborator

Yoshifumi (@yotsuda) Please resolve merge conflict. In other PR too.

@yotsuda
Yoshifumi (yotsuda) force-pushed the add-convertto-json-depth-multilevel-tests branch from daaec64 to f2a4a2e Compare February 6, 2026 06:07
@yotsuda

Yoshifumi (yotsuda) commented Feb 6, 2026 •

Copy link
Copy Markdown
Contributor Author

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

@iSazonov Ilya (iSazonov) added the CL-Test Indicates that a PR should be marked as a test change in the Change Log label Feb 6, 2026
Yoshifumi (yotsuda) added a commit to yotsuda/PowerShell that referenced this pull request Feb 6, 2026
@iSazonov Ilya (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
Copy Markdown
Member

Yoshifumi (@yotsuda) and Ilya (@iSazonov) Same here, please resolve the conflict. Thanks!

@iSazonov

Copy link
Copy Markdown
Collaborator

Yoshifumi (@yotsuda) Please resolve merge conflicts.

Yoshifumi (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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
@yotsuda
Yoshifumi (yotsuda) force-pushed the add-convertto-json-depth-multilevel-tests branch from 13c77c8 to e9b1545 Compare February 7, 2026 00:19
@yotsuda

Copy link
Copy Markdown
Contributor Author

Dongbo Wang (@daxian-dbw) Ilya (@iSazonov) Thanks!!
Rebased onto the latest master. Merge conflicts resolved.

@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 664ac75 into PowerShell:master Feb 10, 2026
36 checks passed
@yotsuda
Yoshifumi (yotsuda) deleted the add-convertto-json-depth-multilevel-tests branch February 10, 2026 02:36
@iSazonov Ilya (iSazonov) self-assigned this Feb 21, 2026
Justin Grote (JustinGrote) pushed a commit to JustinGrote/PowerShell that referenced this pull request Jun 2, 2026
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
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