Skip to content

Commit ff7a012

Browse files
committed
[release/9.0.3xx] Remove the spacing from the table header of the templating new tests (#46001)
1 parent ba010fe commit ff7a012

7 files changed

+14
-8
lines changed

test/dotnet-new.Tests/Approvals/DotnetNewListTests.BasicTest_WhenLegacyCommandIsUsed_common.Linux.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
For more information, run:
33
dotnet new list -h
44
These templates matched your input:
5-
Template Name Short Name Language Tags
5+
Template
66
API
77
ASP.NET
88
Blazor

test/dotnet-new.Tests/Approvals/DotnetNewListTests.BasicTest_WhenLegacyCommandIsUsed_common.OSX.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
For more information, run:
33
dotnet new list -h
44
These templates matched your input:
5-
Template Name Short Name Language Tags
5+
Template
66
API
77
ASP.NET
88
Blazor

test/dotnet-new.Tests/Approvals/DotnetNewListTests.BasicTest_WhenLegacyCommandIsUsed_common.Windows.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
For more information, run:
33
dotnet new list -h
44
These templates matched your input:
5-
Template Name Short Name Language Tags
5+
Template
66
API
77
ASP.NET
88
Blazor

test/dotnet-new.Tests/Approvals/DotnetNewListTests.BasicTest_WhenListCommandIsUsed.Linux.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
These templates matched your input:
2-
Template Name Short Name Language Tags
2+
Template
33
API
44
ASP.NET
55
Blazor

test/dotnet-new.Tests/Approvals/DotnetNewListTests.BasicTest_WhenListCommandIsUsed.OSX.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
These templates matched your input:
2-
Template Name Short Name Language Tags
2+
Template
33
API
44
ASP.NET
55
Blazor

test/dotnet-new.Tests/Approvals/DotnetNewListTests.BasicTest_WhenListCommandIsUsed.Windows.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
These templates matched your input:
2-
Template Name Short Name Language Tags
2+
Template
33
API
44
ASP.NET
55
Blazor

test/dotnet-new.Tests/DotnetNewListTests.Approval.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
@@ -57,9 +57,15 @@ private static void ScrubData(StringBuilder input)
5757

5858
foreach (var line in lines)
5959
{
60-
if (line.StartsWith("-----"))
60+
// start trimming whitespace and anything but the first word with the start of the table
61+
if (line.StartsWith("Template Name", StringComparison.Ordinal))
6162
{
6263
isTable = true;
64+
}
65+
66+
// We don't want to have to count how many dashes are in the table separator as this can change based on the width of the column
67+
if (line.StartsWith("-----", StringComparison.Ordinal))
68+
{
6369
continue;
6470
}
6571

0 commit comments

Comments
 (0)