Skip to content

Commit

Permalink
♻️ Misc additional fixes (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
vexx32 committed Jun 14, 2020
1 parent 874f27c commit f81479b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
5 changes: 4 additions & 1 deletion PSKoans/Koans/Foundations/AboutHashtables.Koans.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,11 @@ Describe 'Hashtables' {
}

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

$Hashtable.ContainsKey('Carrots') | Should -BeTrue
Expand Down
17 changes: 11 additions & 6 deletions PSKoans/Koans/Foundations/AboutLoopsAndPipelines.Koans.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,22 @@ Describe 'Pipelines and Loops' {
}

It 'can loop a set number of times' {
$Values = for ($i = 0; $i -lt 5; $i++) {
$Values = for ($num = 0; $num -lt 5; $num++) {
<#
For loops are quite rare in native PowerShell code. They have their uses, but are
frequently too semantically obscure to have a place in PS's verbose ecosystem.
Remember:
1. ++ after the variable will reference the existing value then increment the variable.
2. ++ before the variable will increment the variable and then reference the new value.
#>
$i
$num
}
$Values | Should -Be __

# What will the above loop store in $Values?
$Values | Should -Be @(
__
__
__
__
__
)
}

It 'can loop while a condition is $true' {
Expand Down
1 change: 1 addition & 0 deletions PSKoans/Koans/Katas/SortingCharacters.Koans.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ param()
sorts all characters in a string alphabetically. Punctuation and spaces should be ignored entirely.
#>
Describe 'Kata - Sorting Characters' {

BeforeAll {
$Verification = {
$Functions = [Hashset[string]]::new([StringComparer]::OrdinalIgnoreCase)
Expand Down

0 comments on commit f81479b

Please sign in to comment.