Skip to content

Remove the spacing from the table header of the templating new tests #46000

New issue

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

Merged
merged 3 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
For more information, run:
dotnet new list -h
These templates matched your input:
Template Name Short Name Language Tags
Template
API
ASP.NET
Blazor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
For more information, run:
dotnet new list -h
These templates matched your input:
Template Name Short Name Language Tags
Template
API
ASP.NET
Blazor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
For more information, run:
dotnet new list -h
These templates matched your input:
Template Name Short Name Language Tags
Template
API
ASP.NET
Blazor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
These templates matched your input:
Template Name Short Name Language Tags
Template
API
ASP.NET
Blazor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
These templates matched your input:
Template Name Short Name Language Tags
Template
API
ASP.NET
Blazor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
These templates matched your input:
Template Name Short Name Language Tags
Template
API
ASP.NET
Blazor
Expand Down
10 changes: 8 additions & 2 deletions test/dotnet-new.Tests/DotnetNewListTests.Approval.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

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

foreach (var line in lines)
{
if (line.StartsWith("-----"))
// start trimming whitespace and anything but the first word with the start of the table
if (line.StartsWith("Template Name", StringComparison.Ordinal))
{
isTable = true;
}

// 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
if (line.StartsWith("-----", StringComparison.Ordinal))
{
continue;
}

Expand Down
Loading