mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Fix HOMEPATH and Wait-Event tests
On Windows, HOMEPATH is not necessarily `\Users\username`, so the test was made to match more loosely. Wait-Event's timeout varied more than expected, so the test's range was increased.
This commit is contained in:
1 parent
6ce53af354
commit
8adffbb2e2
2 files changed
+4
-3
No files matched your search
@@ -23,8 +23,8 @@
|
|||||||
It "Should have the correct HOME" {
|
It "Should have the correct HOME" {
|
||||||
if ($isWindows)
|
if ($isWindows)
|
||||||
{
|
{
|
||||||
$expected = "\Users\" + $ENV:USERNAME
|
$expected = "\Users"
|
||||||
$ENV:HOMEPATH | Should Be $expected
|
Split-Path $ENV:HOMEPATH -Parent | Should Be $expected
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ Describe "Wait-Event" {
|
|||||||
# raised because it is fake
|
# raised because it is fake
|
||||||
Wait-Event -Timeout 1 -SourceIdentifier "FakeEvent"
|
Wait-Event -Timeout 1 -SourceIdentifier "FakeEvent"
|
||||||
$stopwatch.Stop()
|
$stopwatch.Stop()
|
||||||
$stopwatch.ElapsedMilliseconds | Should BeGreaterThan 999
|
$stopwatch.ElapsedMilliseconds | Should BeGreaterThan 500
|
||||||
|
$stopwatch.ElapsedMilliseconds | Should BeLessThan 1500
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user