File tree 2 files changed +5
-5
lines changed
src/System.Management.Automation/FormatAndOutput/common
test/powershell/engine/Formatting
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ private string PlainText
98
98
}
99
99
100
100
// graphics/color mode ESC[1;2;...m
101
- private const string GraphicsRegex = @"(\x1b\[\d+ (;\d+)*m)" ;
101
+ private const string GraphicsRegex = @"(\x1b\[\d* (;\d+)*m)" ;
102
102
103
103
// CSI escape sequences
104
104
private const string CsiRegex = @"(\x1b\[\?\d+[hl])" ;
Original file line number Diff line number Diff line change @@ -81,11 +81,11 @@ Describe 'OutputRendering tests' -Tag 'CI' {
81
81
}
82
82
83
83
It ' ToString(OutputRendering) works correctly' {
84
- $s = [System.Management.Automation.Internal.StringDecorated ]::new($PSStyle.Foreground.Red + ' Hello' )
84
+ $s = [System.Management.Automation.Internal.StringDecorated ]::new($PSStyle.Foreground.Red + " Hello`e [m. " )
85
85
$s.IsDecorated | Should - BeTrue
86
- $s.ToString () | Should - BeExactly " $ ( $PSStyle.Foreground.Red ) Hello"
87
- $s.ToString ([System.Management.Automation.OutputRendering ]::ANSI) | Should - BeExactly " $ ( $PSStyle.Foreground.Red ) Hello"
88
- $s.ToString ([System.Management.Automation.OutputRendering ]::PlainText) | Should - BeExactly ' Hello'
86
+ $s.ToString () | Should - BeExactly " $ ( $PSStyle.Foreground.Red ) Hello`e [m. "
87
+ $s.ToString ([System.Management.Automation.OutputRendering ]::ANSI) | Should - BeExactly " $ ( $PSStyle.Foreground.Red ) Hello`e [m. "
88
+ $s.ToString ([System.Management.Automation.OutputRendering ]::PlainText) | Should - BeExactly ' Hello. '
89
89
{ $s.ToString ([System.Management.Automation.OutputRendering ]::Host) } | Should - Throw - ErrorId ' ArgumentException'
90
90
}
91
91
}
You can’t perform that action at this time.
0 commit comments