From d2789a5f068b94d802ce35fbdedcf223f1eb5855 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Thu, 3 Jul 2025 09:03:56 +0200 Subject: [PATCH] Revert "Update ApprovalTests to 7.0.0 and revert workaround " This reverts commit 3676a9eafea1f7c6abc987741fc0d5e078cb16f8. --- Directory.Packages.props | 2 +- .../Help/ApprovalTests.Config.cs | 10 +++++++--- .../Help/HelpBuilderTests.Approval.cs | 7 +++++-- .../System.CommandLine.Tests.csproj | 3 ++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index da1e624248..4de7f06b05 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 bbf662f44f..066c399874 100644 --- a/src/System.CommandLine.Tests/Help/ApprovalTests.Config.cs +++ b/src/System.CommandLine.Tests/Help/ApprovalTests.Config.cs @@ -1,8 +1,12 @@ -using ApprovalTests.Reporters; -using ApprovalTests.Reporters.TestFrameworks; +// Alias workaround for https://github.com/approvals/ApprovalTests.Net/issues/768 +extern alias ApprovalTests; + +using ApprovalTests.ApprovalTests.Reporters; +using ApprovalTests.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.Namers.UseApprovalSubdirectory("Approvals")] + +[assembly: ApprovalTests.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 0cb2b097ce..cfbc8cdcff 100644 --- a/src/System.CommandLine.Tests/Help/HelpBuilderTests.Approval.cs +++ b/src/System.CommandLine.Tests/Help/HelpBuilderTests.Approval.cs @@ -1,10 +1,13 @@ // 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; -using ApprovalTests.Reporters; +using ApprovalTests.ApprovalTests; +using ApprovalTests.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 e448549980..b18cdd74e6 100644 --- a/src/System.CommandLine.Tests/System.CommandLine.Tests.csproj +++ b/src/System.CommandLine.Tests/System.CommandLine.Tests.csproj @@ -30,7 +30,8 @@ - + +