Skip to content

Commit 3b56a76

Browse files
committed
Extend Substring tests to starts with reserved word, ends with reserved word, and reserved word with a letter missing
1 parent 1e5c1b2 commit 3b56a76

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Tests/Rules/AvoidReservedWordsAsFunctionNames.tests.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ $scopedReservedWordCases = foreach ($scope in $functionScopes) {
4747
}
4848
}
4949

50+
# Build variants of reserved words where the reserverd word:
51+
# appearing at the start and end of a function
52+
# name.
5053
$substringReservedWords = $reservedWords | ForEach-Object {
51-
"$($_)Func"
54+
"$($_)A", "A$($_)", $_.Substring(0, $_.Length - 1)
5255
}
5356

5457
$safeFunctionNames = @(

0 commit comments

Comments
 (0)