We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hm, well this is as far as I got with the test and I think I'm going to postpone getting a test for this so we can just get the fix in:
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections.Generic; using System.Management.Automation; using System.Threading; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution; using Microsoft.PowerShell.EditorServices.Services.PowerShell.Host; using Xunit; namespace Microsoft.PowerShell.EditorServices.Test.Console { public class PSHostTests : IDisposable { private readonly PsesInternalHost _psesHost; public PSHostTests() { _psesHost = PsesHostFactory.Create(NullLoggerFactory.Instance); } public void Dispose() { _psesHost.StopAsync().GetAwaiter().GetResult(); } [Trait("Category", "LengthInBufferCells")] [Fact] public void HasLengthInBufferCells() { var script = @"[pscustomobject]@{ a = ""`e[30mtest`e[0m"" } | Format-Table @{ Width = 4; Expression = 'a' } | Out-Default"; IReadOnlyList<string> results = _psesHost.InvokePSCommand<string>( new PSCommand().AddScript(script), new PowerShellExecutionOptions { WriteInputToHost = true, WriteOutputToHost = true, ThrowOnError = false, InterruptCurrentForeground = true }, CancellationToken.None); Assert.NotEmpty(results); } } }
Originally posted by @andschwa in #1606 (comment)
The text was updated successfully, but these errors were encountered:
The missing piece is a test PSHost that inherits EditorServicesConsolePSHost and overwrites WriteLine to something that just adds to a StringBuilder.
PSHost
EditorServicesConsolePSHost
WriteLine
StringBuilder
Sorry, something went wrong.
Ah! _psesHost has a host that is EditorServicesConsolePSHost. I'll try to create a test harness that does what you say.
_psesHost
andyleejordan
No branches or pull requests
Hm, well this is as far as I got with the test and I think I'm going to postpone getting a test for this so we can just get the fix in:
Originally posted by @andschwa in #1606 (comment)
The text was updated successfully, but these errors were encountered: