@@ -654,20 +654,6 @@ Describe "Test suite for Microsoft.PowerShell.Archive module" -Tags "BVT" {
654
654
Compress-Archive - Path $sourcePath - DestinationPath $destinationPath
655
655
$destinationPath | Should Exist
656
656
}
657
-
658
- It " Validate that Compress-Archive cmdlet works with backslashes in paths" {
659
- $sourcePath = " $TestDrive \SourceDir\ChildDir-1"
660
- $destinationPath = " $TestDrive \SampleBackslashFile.zip"
661
- Compress-Archive - Path $sourcePath - DestinationPath $destinationPath
662
- $destinationPath | Should Exist
663
- }
664
-
665
- It " Validate that Compress-Archive cmdlet works with forward slashes in paths" {
666
- $sourcePath = " $TestDrive /SourceDir/ChildDir-1"
667
- $destinationPath = " $TestDrive /SampleForwardslashFile.zip"
668
- Compress-Archive - Path $sourcePath - DestinationPath $destinationPath
669
- $destinationPath | Should Exist
670
- }
671
657
}
672
658
673
659
Context " Expand-Archive - Parameter validation test cases" {
@@ -1084,31 +1070,21 @@ Describe "Test suite for Microsoft.PowerShell.Archive module" -Tags "BVT" {
1084
1070
}
1085
1071
}
1086
1072
1087
- It " Validate that Expand-Archive cmdlet works with backslashes in paths" {
1088
- $sourcePath = " $TestDrive \SamplePreCreatedArchive.zip"
1089
- $content = " Some Data"
1090
- $destinationPath = " $TestDrive \DestDirForBackslashExpand"
1091
- $files = @ (" Sample-1.txt" , " Sample-2.txt" )
1092
-
1093
- Expand-Archive - Path $sourcePath - DestinationPath $destinationPath
1094
- foreach ($currentFile in $files )
1095
- {
1096
- $expandedFile = Join-Path $destinationPath - ChildPath $currentFile
1097
- Test-Path $expandedFile | Should Be $True
1098
- Get-Content $expandedFile | Should Be $content
1099
- }
1100
- }
1073
+ It " Validate that Compress-Archive/Expand-Archive work with backslashes and forward slashes in paths" {
1074
+ $sourcePath = " $TestDrive \SourceDir/ChildDir-2"
1075
+ $archivePath = " $TestDrive \MixedSlashesDir1/MixedSlashesDir2/SampleMixedslashFile.zip"
1076
+ $expandPath = " $TestDrive \MixedSlashesExpandDir/DirA\DirB/DirC"
1101
1077
1102
- It " Validate that Expand-Archive cmdlet works with forward slashes in paths" {
1103
- $sourcePath = " $TestDrive /SamplePreCreatedArchive.zip"
1078
+ New-Item - Path (Split-Path $archivePath ) - Type Directory | Out-Null
1079
+ Compress-Archive - Path $sourcePath - DestinationPath $archivePath
1080
+ $archivePath | Should Exist
1081
+
1104
1082
$content = " Some Data"
1105
- $destinationPath = " $TestDrive /DestDirForForwardslashExpand"
1106
- $files = @ (" Sample-1.txt" , " Sample-2.txt" )
1107
-
1108
- Expand-Archive - Path $sourcePath - DestinationPath $destinationPath
1083
+ $files = @ (" ChildDir-2$ ( $DS ) Sample-5.txt" , " ChildDir-2$ ( $DS ) Sample-6.txt" )
1084
+ Expand-Archive - Path $archivePath - DestinationPath $expandPath
1109
1085
foreach ($currentFile in $files )
1110
1086
{
1111
- $expandedFile = Join-Path $destinationPath - ChildPath $currentFile
1087
+ $expandedFile = Join-Path $expandPath - ChildPath $currentFile
1112
1088
Test-Path $expandedFile | Should Be $True
1113
1089
Get-Content $expandedFile | Should Be $content
1114
1090
}
0 commit comments