Skip to content

Commit

Permalink
🐛 (vexx32#470) Ensure $matches is populated properly (vexx32#471)
Browse files Browse the repository at this point in the history
It 'does not need to match the entire string' now has $matches[0] populated without having to test again.

Unsure whether a retest within the following IT statements would be better for flow, but this works.
  • Loading branch information
DEberhardt committed Mar 6, 2022
1 parent 94355e2 commit 1317701
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,20 @@ Describe 'Quantifiers' {

Context '*' {

BeforeEach {
$firstTest = ('pears' -match 'p*ears')
$secondTest = ('shears' -match 'p*ears')
}

It 'specifies 0 or more of something' {
<#
The * character specifies "0 or more" of the symbol or group that comes
The * character specifies "0 or more" of the symbol or group that comes
immediately before it. In this case, the pattern can be read aloud as "zero or more
of the letter p, then the letters e, a, r, and s."
#>
$____ | Should -Be ('pears' -match 'p*ears')
$____ | Should -Be ('shears' -match 'p*ears')

$____ | Should -Be $firstTest
$____ | Should -Be $secondTest
}

It 'does not need to match the entire string' {
Expand Down

0 comments on commit 1317701

Please sign in to comment.