diff --git a/src/libpsl-native b/src/libpsl-native index 8650c6a6a..19dbaaf54 160000 --- a/src/libpsl-native +++ b/src/libpsl-native @@ -1 +1 @@ -Subproject commit 8650c6a6a1f782361d49191e935eef616f190155 +Subproject commit 19dbaaf54cfa47c0673af6a3da2c4dad5fb56e8f diff --git a/src/monad b/src/monad index 07f23acd1..e0dc79b07 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit 07f23acd10f2158031ca876d74788236d0aa9e83 +Subproject commit e0dc79b0744bba098e931a8266df97da478eccda diff --git a/test/powershell/New-Item.Tests.ps1 b/test/powershell/New-Item.Tests.ps1 index c5f33a410..ef4e42090 100644 --- a/test/powershell/New-Item.Tests.ps1 +++ b/test/powershell/New-Item.Tests.ps1 @@ -1,5 +1,10 @@ function Clean-State { + if (Test-Path $FullyQualifiedLink) + { + Remove-Item $FullyQualifiedLink -Force + } + if (Test-Path $FullyQualifiedFile) { Remove-Item $FullyQualifiedFile -Force @@ -7,7 +12,7 @@ if (Test-Path $FullyQualifiedFolder) { - Remove-Item $FullyQualifiedFolder -Recurse -Force + Remove-Item $FullyQualifiedFolder -Force } } @@ -15,8 +20,10 @@ Describe "New-Item" { $tmpDirectory = $TestDrive $testfile = "testfile.txt" $testfolder = "newDirectory" + $testlink = "testlink" $FullyQualifiedFile = Join-Path -Path $tmpDirectory -ChildPath $testfile $FullyQualifiedFolder = Join-Path -Path $tmpDirectory -ChildPath $testfolder + $FullyQualifiedLink = Join-Path -Path $tmpDirectory -ChildPath $testlink BeforeEach { Clean-State @@ -92,4 +99,25 @@ Describe "New-Item" { Test-Path $FullyQualifiedFile | Should Be $false } + + It "Should create a symbolic link of a file without error" { + New-Item -Name $testfile -Path $tmpDirectory -ItemType file + Test-Path $FullyQualifiedFile | Should Be $true + + New-Item -ItemType SymbolicLink -Target $FullyQualifiedFile -Name $testlink -Path $tmpDirectory + Test-Path $FullyQualifiedLink | Should Be $true + } + + It "Should create a symbolic link from directory without error" { + New-Item -Name $testFolder -Path $tmpDirectory -ItemType directory + Test-Path $FullyQualifiedFolder | Should Be $true + + New-Item -ItemType SymbolicLink -Target $FullyQualifiedFolder -Name $testlink -Path $tmpDirectory + Test-Path $FullyQualifiedLink | Should Be $true + + # Remove the link explicitly to avoid broken symlink issue + Remove-Item $FullyQualifiedLink -Force + } + + }