Add new test for Format-Custom to avoid data loss (#11393)
This commit is contained in:
parent
1397deffe4
commit
0c8aa53a90
|
@ -297,7 +297,16 @@ class MyLeaf2
|
|||
$expectedResult = $expectedResult -replace "[{} `n\r]",""
|
||||
$result | Should -Be $expectedResult
|
||||
}
|
||||
}
|
||||
|
||||
It "Format-Custom should not lost data" {
|
||||
# See https://github.com/PowerShell/PowerShell/pull/11342 for more information
|
||||
$data = (Get-Help Out-Null).Examples
|
||||
$formattedData = $data | Format-Custom | Out-String
|
||||
$formattedData | Should -BeLike "*$($data.Example.title)*"
|
||||
$formattedData | Should -BeLike "*$($data.Example.code)*"
|
||||
$formattedData | Should -BeLike "*$($data.Example.remarks.Text)*"
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Format-Custom with expression based EntrySelectedBy in a CustomControl" -Tags "CI" {
|
||||
BeforeAll {
|
||||
|
|
Loading…
Reference in a new issue