-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy path.test.ps1
27 lines (23 loc) · 948 Bytes
/
.test.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$v2 = $PSVersionTable.PSVersion.Major -eq 2
$v3 = $PSVersionTable.PSVersion.Major -eq 3
# Synopsis: Unexpected behaviour in v3.
# In v2 and v4 the nested prompt is entered.
# This is not tested because user interaction is involved.
task Test-1.1-EnterNestedPrompt-ignored -If $v3 {
($r = .\Test-1.1-EnterNestedPrompt-ignored.ps1)
equals 'Before nested prompt|After nested prompt' ($r -join '|')
}
# Synopsis: Unexpected behaviour in v3.
# In v2 and v4 the nested prompt is entered.
# This is not tested because user interaction is involved.
task Test-1.2-EnterNestedPrompt-ignored -If $v3 {
($r = .\Test-1.2-EnterNestedPrompt-ignored.ps1)
equals 'Before nested prompt|After nested prompt' ($r -join '|')
}
# Synopsis: Expected behaviour in v2.
# In v3 and v4 the test is not exiting as expected.
# This is not tested because user interaction is involved.
task Test-3-NoExit-exit -If $v2 {
($r = .\Test-3-NoExit-exit.ps1)
equals '42' $r
}