PowerShell/test
Dongbo Wang 4c29f5768d Fix bugs with expression redirected to file (#4847)
When handling file redirection for CommandExpression, we don't call 'DoComplete' on the underlying PipelineProcessor of the FileRedirection object, and thus the EndProcessing method is not called on Out-File, which causes different behaviors between <expr> > out.txt and <expr> | Out-File out.txt.

The fix is to make sure 'DoComplete' is called after the stream output has been written to the redirection pipe.

Also fix another issue

This PR also fixes an issue that could mess up restoring the original pipes. Here is the repro:

PS> 1 *> b.txt > a.txt; 123
Cannot perform operation because object "PipelineProcessor" has already been disposed
The root cause is that we don't always restore pipes in the correct order. Please see the code changes in Compiler.cs for more details.

Fix #4812
2017-09-20 14:39:02 -07:00
..
common/markdown Update docs about the pull-request-process (#4710) 2017-09-04 10:29:20 -07:00
csharp Build powershell core using the generic RID 'linux-x64' (#4841) 2017-09-18 09:31:07 -07:00
docker/networktest PSScriptAnalyzer fixes by category (#4261) 2017-07-21 21:03:49 -07:00
powershell Fix bugs with expression redirected to file (#4847) 2017-09-20 14:39:02 -07:00
PSReadLine Build powershell core using the generic RID 'linux-x64' (#4841) 2017-09-18 09:31:07 -07:00
shebang Reorganize tests 2016-01-14 17:00:06 -08:00
tools Port tests for constrained language mode (#4816) 2017-09-19 14:53:29 -07:00
README.md Add test/README.md 2016-03-30 23:30:26 -07:00
Test.Common.props Move to the official .NET Core 2.0 (#4603) 2017-08-16 17:32:46 -07:00

Testing

The tests are organized by testing language. Thus Pester tests, which are written in the PowerShell language, are in ./powershell and xUnit tests, written in C#, are in ./csharp. The sanity tests for the Full .NET build of PowerShell are in ./fullclr, and the third-party shebang test is in ./shebang.