-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
Move cursor right (it stops at end of line), then back to justify the output. This makes the localization less flexible since the formatting + justification is handled in code, but makes it a lot easier to understand. In the future reordering in translations would need to be handled fairly carefully. Avoid a bunch of overwrite problems by simplifiying the should-we-do-a-fancy-overwrite decision to "is just time tick" or "just overwrite it all".
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
using Microsoft.Build.Logging.TerminalLogger; | ||
|
||
using VerifyTests; | ||
using VerifyXunit; | ||
using Xunit; | ||
|
||
using static VerifyXunit.Verifier; | ||
|
||
|
||
namespace Microsoft.Build.CommandLine.UnitTests; | ||
|
||
[UsesVerify] | ||
public class NodeStatus_Tests | ||
{ | ||
private readonly NodeStatus _status = new("Namespace.Project", "TargetFramework", "Target", new()); | ||
|
||
public NodeStatus_Tests() | ||
{ | ||
UseProjectRelativeDirectory("Snapshots"); | ||
} | ||
|
||
[Fact] | ||
public async Task EverythingFits() | ||
{ | ||
NodesFrame frame = new(new[] { _status }, width: 80, height: 5); | ||
|
||
await Verify(frame.RenderNodeStatus(_status).ToString()); | ||
} | ||
|
||
[Fact] | ||
public async Task TargetIsTruncatedFirst() | ||
{ | ||
NodesFrame frame = new(new[] { _status }, width: 45, height: 5); | ||
|
||
await Verify(frame.RenderNodeStatus(_status).ToString()); | ||
} | ||
|
||
[Fact] | ||
public async Task NamespaceIsTruncatedNext() | ||
{ | ||
NodesFrame frame = new(new[] { _status }, width: 40, height: 5); | ||
|
||
await Verify(frame.RenderNodeStatus(_status).ToString()); | ||
} | ||
|
||
[Fact] | ||
public async Task GoesToProject() | ||
{ | ||
NodesFrame frame = new(new[] { _status }, width: 10, height: 5); | ||
|
||
await Verify(frame.RenderNodeStatus(_status).ToString()); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Namespace.Project [36;1mTargetFramework[m [120G[13DTarget (0.0s) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Project |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Project [36;1mTargetFramework[m [120G[7D (0.0s) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Namespace.Project [36;1mTargetFramework[m [120G[7D (0.0s) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
]9;4;3;\[?25l[1F | ||
project [36;1mtfName[m Build (0.0s) | ||
project [36;1mtfName[m [120G[12DBuild (0.0s) | ||
[?25h[?25l[2F | ||
project [36;1mtf2[m Build (0.0s)[K | ||
[K project [36;1mtf2[m [120G[12DBuild (0.0s) | ||
[?25h |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[?25l[1F | ||
project [36;1mtfName[m Build (0.0s) | ||
project [36;1mtfName[m [120G[12DBuild (0.0s) | ||
[?25h[?25l[2F | ||
project [36;1mtf2[m Build (0.0s)[K | ||
[K project [36;1mtf2[m [120G[12DBuild (0.0s) | ||
[?25h |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
]9;4;3;\[?25l[1F | ||
project [36;1mtfName[m Build (0.0s) | ||
project [36;1mtfName[m [120G[12DBuild (0.0s) | ||
[?25h[?25l[2F | ||
project [36;1mtf2[m Build (0.0s)[K | ||
[K project [36;1mtf2[m [120G[12DBuild (0.0s) | ||
[?25h |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
]9;4;3;\[?25l[1F | ||
project Build (0.0s) | ||
project [120G[12DBuild (0.0s) | ||
[?25h |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[?25l[1F | ||
project Build (0.0s) | ||
project [120G[12DBuild (0.0s) | ||
[?25h |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
]9;4;3;\[?25l[1F | ||
project Build (0.0s) | ||
project [120G[12DBuild (0.0s) | ||
[?25h |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.