◐ Shell
clean mode source ↗

Add comprehensive scalar type tests for ConvertTo-Json by yotsuda · Pull Request #26736 · PowerShell/PowerShell

@yotsuda

iSazonov

@yotsuda

iSazonov

@yotsuda

iSazonov

Address review feedback by replacing all -Match assertions with -BeExactly
for more precise test validation. Also add missing $null test case to
Primitive scalar types.

Changes:
- Add $null test case to Primitive scalar types TestCases
- Replace -Match with -BeExactly in ETS properties tests (9 instances)
- Remove redundant -Not -Match assertion in String ETS test
- Calculate timezone offset dynamically for DateTime Local kind test
- Use full JSON string comparison for Guid array, Array ETS, and Hashtable ETS tests

All tests pass successfully (114 tests).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

@iSazonov iSazonov added the CL-Test

Indicates that a PR should be marked as a test change in the Change Log

label

Feb 3, 2026

iSazonov

…-Json.Tests.ps1

Co-authored-by: Ilya <darpa@yandex.ru>

iSazonov

@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 3, 2026

daxian-dbw

@yotsuda yotsuda deleted the add-convertto-json-scalar-tests-v2 branch

February 10, 2026 00:09

JustinGrote pushed a commit to JustinGrote/PowerShell that referenced this pull request

Jun 2, 2026