Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,7 @@ private static char Backtick(char c)
case '0': return '\0';
case 'a': return '\a';
case 'b': return '\b';
case 'e': return '\u001b';
case 'f': return '\f';
case 'n': return '\n';
case 'r': return '\r';
Expand Down
5 changes: 5 additions & 0 deletions test/powershell/Language/Parser/Parser.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ Describe "ParserTests (admin\monad\tests\monad\src\engine\core\ParserTests.cs)"
$result | should be "foo bar"
}

It "Test that escaping the character 'e' returns the ESC character (0x1b)." {
$result = ExecuteCommand '"`e"'
$result | should be ([char]0x1b)
}

It "Test that escaping any character with no special meaning just returns that char. (line 602)" {
$result = ExecuteCommand '"fo`obar"'
$result | should be "foobar"
Expand Down