(#3694) Fix edge case with template naming #3736
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description Of Changes
A change was made to try to make sure that everything related to
template, the name, the directories, etc are all lower case. That way,
in the absence of a StringComparer, a simple comparison can be made.
However, one of our automated tests caught a problem with this approach
when the code is checking for the defaultTemplate and whether it had
been overridden or not. This code path hadn't been ToLower'ed and as a
result, when there are uppercase letters in the path, for example the
"C:\ProgramData" location, the check would fail, and it would no longer
output that the default template had been overridden.
This commit addresses that problem by first ToLower'ing these values
ahead of the check. It also switches to using the case-insensitive
IsEqualTo method, which makes the code slightly less complicated, and
easier to follow.
Motivation and Context
Some Test-Kitchen tests were failing, which made us investigate this problem.
Testing
Tested locally, but will also re-run Test-Kitchen tests from this PR.
Operating Systems Testing
Change Types Made
Change Checklist
Related Issue
Relates to #3694