Skip to content

Commit f81479b

Browse files
authored
♻️ Misc additional fixes (#396)
1 parent 874f27c commit f81479b

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

PSKoans/Koans/Foundations/AboutHashtables.Koans.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,11 @@ Describe 'Hashtables' {
172172
}
173173

174174
It 'can check if keys or values are present in the hashtable' {
175+
# Enter keys and values in this table to make the below tests pass.
176+
# You should not need to modify the `Should` assertions themselves.
175177
$Hashtable = @{
176-
# Enter keys and values in this table to make the below tests pass
178+
# Example:
179+
# KeyName = Value
177180
}
178181

179182
$Hashtable.ContainsKey('Carrots') | Should -BeTrue

PSKoans/Koans/Foundations/AboutLoopsAndPipelines.Koans.ps1

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,22 @@ Describe 'Pipelines and Loops' {
115115
}
116116

117117
It 'can loop a set number of times' {
118-
$Values = for ($i = 0; $i -lt 5; $i++) {
118+
$Values = for ($num = 0; $num -lt 5; $num++) {
119119
<#
120120
For loops are quite rare in native PowerShell code. They have their uses, but are
121121
frequently too semantically obscure to have a place in PS's verbose ecosystem.
122-
Remember:
123-
1. ++ after the variable will reference the existing value then increment the variable.
124-
2. ++ before the variable will increment the variable and then reference the new value.
125122
#>
126-
$i
123+
$num
127124
}
128-
$Values | Should -Be __
125+
126+
# What will the above loop store in $Values?
127+
$Values | Should -Be @(
128+
__
129+
__
130+
__
131+
__
132+
__
133+
)
129134
}
130135

131136
It 'can loop while a condition is $true' {

PSKoans/Koans/Katas/SortingCharacters.Koans.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ param()
1616
sorts all characters in a string alphabetically. Punctuation and spaces should be ignored entirely.
1717
#>
1818
Describe 'Kata - Sorting Characters' {
19+
1920
BeforeAll {
2021
$Verification = {
2122
$Functions = [Hashset[string]]::new([StringComparer]::OrdinalIgnoreCase)

0 commit comments

Comments
 (0)