Skip to content

Conversation

@austoonz
Copy link
Contributor

Issue #, if available:

#41

Description of changes:

  • Add Assert-PathEquals helper function to normalize path separators for cross-platform compatibility in unit tests
  • Replace direct string path comparisons with Assert-PathEquals in Get-Handler.Tests.ps1 and Set-PSModulePath.Tests.ps1
  • Remove Windows-specific read-only directory test that was causing cross-platform issues (not relevant for the Lambda runtime which is Linux only)
  • Ensure all unit tests pass on Windows, Linux, and macOS by handling path separator differences transparently

The new Assert-PathEquals function normalizes both actual and expected paths to use forward slashes before comparison, allowing tests to pass regardless of the platform's native path separator behavior.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Resolves awslabs#41 - Windows Unit Test Path Compatibility Issue

- Add Assert-PathEquals helper function to normalize path separators
  for cross-platform compatibility in unit tests
- Replace direct string path comparisons with Assert-PathEquals in
  Get-Handler.Tests.ps1 and Set-PSModulePath.Tests.ps1
- Remove Windows-specific read-only directory test that was causing
  cross-platform issues
- Ensure all unit tests pass on Windows, Linux, and macOS by handling
  path separator differences transparently

The new Assert-PathEquals function normalizes both actual and expected
paths to use forward slashes before comparison, allowing tests to pass
regardless of the platform's native path separator behavior.
@austoonz austoonz merged commit 55c8115 into awslabs:main Jul 18, 2025
2 checks passed
@austoonz austoonz deleted the chore/fix-xplat-unit-testing branch July 18, 2025 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant