Skip to content

move to Verify #2616

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,13 @@ dotnet_style_qualification_for_field=false:warning
dotnet_style_qualification_for_method=false:warning
dotnet_style_qualification_for_property=false:warning
dotnet_style_require_accessibility_modifiers=for_non_interface_members:hint

# Verify
[*.{received,verified}.{txt}]
charset = utf-8-bom
end_of_line = lf
indent_size = unset
indent_style = unset
insert_final_newline = false
tab_width = unset
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@
# treat as binary
###############################################################################
*.snk binary

# Verify
*.verified.txt text eol=lf working-tree-encoding=UTF-8
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,5 @@ TestResults/
.fake
.ionide

# ApprovalTests
# Verify
*.received.txt
10 changes: 3 additions & 7 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
<Project>

<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<!-- Using multiple feeds isn't supported by Maestro: https://github.com/dotnet/arcade/issues/14155. -->
<NoWarn>$(NoWarn);NU1507</NoWarn>
</PropertyGroup>

<ItemGroup>
<!-- Roslyn dependencies -->
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.0.1" />
<!-- Runtime dependencies -->
<PackageVersion Include="Microsoft.Bcl.Memory" Version="9.0.6" />
<!-- external dependencies -->
<PackageVersion Include="ApprovalTests" Version="7.0.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.1" />
<PackageVersion Include="AwesomeAssertions" Version="8.1.0" />
<PackageVersion Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="System.Memory" Version="4.5.5" />
<PackageVersion Include="Verify.Xunit" Version="30.4.0" />
</ItemGroup>

<ItemGroup Condition="'$(DisableArcade)' == '1'">
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<!-- The xunit version should be kept in sync with the one that Arcade promotes -->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Arcade promote xunit 2.9.3 now or in the near future?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont know

<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2" />
<PackageVersion Include="xunit" Version="$(XUnitVersion)" />
<PackageVersion Include="xunit.runner.visualstudio" Version="$(XUnitRunnerVisualStudioVersion)" />
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
<PropertyGroup>
<VersionPrefix>2.0.0</VersionPrefix>
<PreReleaseVersionLabel>beta7</PreReleaseVersionLabel>

<XUnitVersion>2.9.3</XUnitVersion>
<XUnitAnalyzersVersion>1.22.0</XUnitAnalyzersVersion>
<XUnitRunnerVisualStudioVersion>3.1.1</XUnitRunnerVisualStudioVersion>

</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
// 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.

using ApprovalTests;
using ApprovalTests.Reporters;
using System.Threading.Tasks;
using VerifyXunit;
using Xunit;

namespace System.CommandLine.ApiCompatibility.Tests;

public class ApiCompatibilityApprovalTests
public class ApiCompatibilityTests
{
[Fact]
[UseReporter(typeof(DiffReporter))]
public void System_CommandLine_api_is_not_changed()
public Task System_CommandLine_api_is_not_changed()
{
var contract = ApiContract.GenerateContractForAssembly(typeof(ParseResult).Assembly);
Approvals.Verify(contract);
return Verifier.Verify(contract);
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
Expand All @@ -5,11 +5,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ApprovalTests" />
<ProjectReference Include="..\System.CommandLine\System.CommandLine.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\System.CommandLine\System.CommandLine.csproj" />
<PackageReference Include="Verify.Xunit" />
</ItemGroup>

</Project>
8 changes: 0 additions & 8 deletions src/System.CommandLine.Tests/Help/ApprovalTests.Config.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@

using Xunit;
using System.IO;
using ApprovalTests;
using ApprovalTests.Reporters;
using System.Threading.Tasks;
using VerifyXunit;

namespace System.CommandLine.Tests.Help
{
public partial class HelpBuilderTests
{
[Fact]
[UseReporter(typeof(DiffReporter))]
public void Help_layout_has_not_changed()
public Task Help_layout_has_not_changed()
{
var command = new Command("the-root-command", "Test description")
{
Expand Down Expand Up @@ -75,7 +74,7 @@ public void Help_layout_has_not_changed()

StringWriter writer = new();
GetHelpBuilder(LargeMaxWidth).Write(command, writer);
Approvals.Verify(writer.ToString());
return Verifier.Verify(writer.ToString());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="ApprovalTests" />
<PackageReference Include="AwesomeAssertions" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" />
<PackageReference Include="Verify.Xunit" />
</ItemGroup>

<ItemGroup Condition="'$(DisableArcade)' == '1'">
Expand Down
10 changes: 10 additions & 0 deletions src/System.CommandLine.Tests/VerifyChecksTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Threading.Tasks;
using VerifyXunit;
using Xunit;

public class VerifyChecksTests
{
[Fact]
public Task Run() =>
VerifyChecks.Run();
}
Loading