Should-Throw
(and Should -Throw
): Backtick is kept in error message when escaping wildcard characters
#2558
Closed
3 tasks done
Labels
Checklist
What is the issue?
When having wildcard characters in the
ExceptionMessage
(Should-Throw
) orExpectedMessage
(Should -Throw
) they are not removed from the expected message in the console making it look like the string is expected to actually have backticks. This is a minor issue, but maybe it possible to make it look better in the futuee.This is related to issue #1793 which might or might not resolve this.
Expected Behavior
Remove backticks from the expected message that is output on the console.
Steps To Reproduce
outputs:
Here it outputs
Expected an exception, with message 'string`[`]' to be thrown
where it would be better if it could have been output asExpected an exception, with message 'string[]' to be thrown
.Describe your environment
Possible Solution?
Maybe just
[System.Management.Automation.WildcardPattern]::Unescape('string`[`]')
on the expected message?The text was updated successfully, but these errors were encountered: