From d728313a6fa78d2561fd98458dde8cd7bef976cb Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Thu, 3 Jul 2025 11:43:37 +0200 Subject: [PATCH 1/2] Reapply "Update ApprovalTests to 7.0.0 and revert workaround " (#2610) This reverts commit 6465818cc348945df767db4c218d9aac821e2cd8. --- Directory.Packages.props | 2 +- .../Help/ApprovalTests.Config.cs | 10 +++------- .../Help/HelpBuilderTests.Approval.cs | 7 ++----- .../System.CommandLine.Tests.csproj | 3 +-- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 4de7f06b05..da1e624248 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -13,7 +13,7 @@ - + diff --git a/src/System.CommandLine.Tests/Help/ApprovalTests.Config.cs b/src/System.CommandLine.Tests/Help/ApprovalTests.Config.cs index 066c399874..bbf662f44f 100644 --- a/src/System.CommandLine.Tests/Help/ApprovalTests.Config.cs +++ b/src/System.CommandLine.Tests/Help/ApprovalTests.Config.cs @@ -1,12 +1,8 @@ -// Alias workaround for https://github.com/approvals/ApprovalTests.Net/issues/768 -extern alias ApprovalTests; - -using ApprovalTests.ApprovalTests.Reporters; -using ApprovalTests.ApprovalTests.Reporters.TestFrameworks; +using ApprovalTests.Reporters; +using ApprovalTests.Reporters.TestFrameworks; // Use globally defined Reporter for ApprovalTests. Please see // https://github.com/approvals/ApprovalTests.Net/blob/master/docs/ApprovalTests/Reporters.md [assembly: UseReporter(typeof(FrameworkAssertReporter))] - -[assembly: ApprovalTests.ApprovalTests.Namers.UseApprovalSubdirectory("Approvals")] +[assembly: ApprovalTests.Namers.UseApprovalSubdirectory("Approvals")] diff --git a/src/System.CommandLine.Tests/Help/HelpBuilderTests.Approval.cs b/src/System.CommandLine.Tests/Help/HelpBuilderTests.Approval.cs index cfbc8cdcff..0cb2b097ce 100644 --- a/src/System.CommandLine.Tests/Help/HelpBuilderTests.Approval.cs +++ b/src/System.CommandLine.Tests/Help/HelpBuilderTests.Approval.cs @@ -1,13 +1,10 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -// Alias workaround for https://github.com/approvals/ApprovalTests.Net/issues/768 -extern alias ApprovalTests; - using Xunit; using System.IO; -using ApprovalTests.ApprovalTests; -using ApprovalTests.ApprovalTests.Reporters; +using ApprovalTests; +using ApprovalTests.Reporters; namespace System.CommandLine.Tests.Help { diff --git a/src/System.CommandLine.Tests/System.CommandLine.Tests.csproj b/src/System.CommandLine.Tests/System.CommandLine.Tests.csproj index b18cdd74e6..e448549980 100644 --- a/src/System.CommandLine.Tests/System.CommandLine.Tests.csproj +++ b/src/System.CommandLine.Tests/System.CommandLine.Tests.csproj @@ -30,8 +30,7 @@ - - + From fcc51e0d6dffeaf193ff812ada87763d4e428b77 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Thu, 3 Jul 2025 11:46:51 +0200 Subject: [PATCH 2/2] Update System.Memory version in test to avoid NuGet downgrade error --- src/System.CommandLine.Tests/System.CommandLine.Tests.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/System.CommandLine.Tests/System.CommandLine.Tests.csproj b/src/System.CommandLine.Tests/System.CommandLine.Tests.csproj index e448549980..a7695f0dc7 100644 --- a/src/System.CommandLine.Tests/System.CommandLine.Tests.csproj +++ b/src/System.CommandLine.Tests/System.CommandLine.Tests.csproj @@ -41,6 +41,8 @@ + +