Format-Table does not return null if the Console width is equal to 0.#6883
Format-Table does not return null if the Console width is equal to 0.#6883kalgiz wants to merge 12 commits intoPowerShell:masterfrom
Conversation
a8afc94 to
948b47c
Compare
There was a problem hiding this comment.
I think we should use try {} finally {} to ensure that the hook was turned off.
There was a problem hiding this comment.
Should we check that console width is default (120)?
There was a problem hiding this comment.
Maybe add in the comment that VSTS console width is 0 and we address this.
948b47c to
b741b1e
Compare
There was a problem hiding this comment.
The test (console width is default (120)) failed and this say the we have broken hook - Console.WindowWidth = 0 doesn't work.
The hook should be here:
if (Console.WindowWidth == 0 || InternalTestHooks.SetConsoleWidthToZero)There was a problem hiding this comment.
The test is failed. It is incorrect test. Console.WindowWidth = 0 doesn't work.
We should have another way.
There was a problem hiding this comment.
Please replace aliases and correct formatting.
|
@kalgiz The PR contains alien commits - please rebase. |
9465770 to
012739f
Compare
012739f to
902d657
Compare
|
@iSazonov I made the rebase. |
|
@SteveL-MSFT @adityapatwardhan Could you please review? |
| # Fill the console window with the string, so that it reaches its max width. | ||
| # Check if the max width is equal to default value (120), to test test hook set. | ||
| $testObject = @{ test = '1' * 200} | ||
| Format-Table -inputobject $testObject | Out-String -str | ForEach-Object {$_.length} | Sort-Object | Select-Object -Last 1 | Should -Be 120 |
There was a problem hiding this comment.
-str should be -Stream
There was a problem hiding this comment.
@adityapatwardhan can you make that change in this PR so we can still take this?
|
This PR has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs within 10 days. |
|
replaced by #7465 |
PR Summary
Format-Table does not return null if the Console width is equal to 0.
Fixes: #6748
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature testsThis change is