mirror of
https://github.com/tw93/Mole.git
synced 2026-03-24 21:00:07 +00:00
fix(windows): harden PowerShell startup fallbacks
This commit is contained in:
@@ -35,6 +35,18 @@ Describe "Base Module" {
|
||||
$script:Icons.Admin | Should -Not -BeNullOrEmpty
|
||||
$script:Icons.Trash | Should -Not -BeNullOrEmpty
|
||||
}
|
||||
|
||||
It "Should expose the full icon table in Windows PowerShell" {
|
||||
$basePath = (Join-Path $script:LibDir "core\base.ps1").Replace("'", "''")
|
||||
$psCommand = "& { . '$basePath'; `$icons = Get-MoleDefaultIcons; [pscustomobject]@{ Count = `$icons.Count; HasSolid = `$icons.ContainsKey('Solid'); HasAdmin = `$icons.ContainsKey('Admin'); HasSuccess = `$icons.ContainsKey('Success') } | ConvertTo-Json -Compress }"
|
||||
$result = & powershell -NoProfile -ExecutionPolicy Bypass -Command $psCommand
|
||||
$iconInfo = $result | ConvertFrom-Json
|
||||
|
||||
$iconInfo.Count | Should -Be 15
|
||||
$iconInfo.HasSolid | Should -Be $true
|
||||
$iconInfo.HasAdmin | Should -Be $true
|
||||
$iconInfo.HasSuccess | Should -Be $true
|
||||
}
|
||||
}
|
||||
|
||||
Context "Visual Defaults Initialization" {
|
||||
|
||||
Reference in New Issue
Block a user