-
Notifications
You must be signed in to change notification settings - Fork 3
/
Feb.2017.tests.ps1
42 lines (39 loc) · 1.24 KB
/
Feb.2017.tests.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
param(
[Parameter(Mandatory = $True,
Position = 0)]
[ValidateNotNullOrEmpty()]
[scriptblock]$function
)
Describe 'PUGS golf, abaqus' {
it 'tests single figure int, 5' {
$int = 5
$result = $function | iex
$result | Should be '-----*****'
}
it 'tests multifigure int, 97042' {
$int = 97042
$result = $function | iex
$result[0] | Should be '-*********'
$result[1] | Should be '---*******'
$result[2] | Should be '----------'
$result[3] | Should be '------****'
$result[4] | Should be '--------**'
$result.length | Should be 5
}
it 'tests multifigure int, [int]::MaxValue' {
$int = [int]::MaxValue
$result = $function | iex
$result[0] | Should be '--------**'
$result[1] | Should be '---------*'
$result[2] | Should be '------****'
$result[3] | Should be '---*******'
$result[4] | Should be '------****'
$result[5] | Should be '--********'
$result[6] | Should be '-------***'
$result[7] | Should be '----******'
$result[8] | Should be '------****'
$result[9] | Should be '---*******'
$result.length | Should be 10
}
}