Skip to content
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

Use xunit.assert fork in dotnet/runtime #91091

Merged
merged 4 commits into from
Aug 25, 2023
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
4 changes: 4 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>4d9945d230fdd8324ce16a31c7dbd74e27a0fc9b</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XUnitAssert" Version="8.0.0-beta.23422.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>9b2af35a6702526dc8a7c5fcadcc44efd0dca170</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="8.0.0-beta.23422.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>4d9945d230fdd8324ce16a31c7dbd74e27a0fc9b</Sha>
Expand Down
5 changes: 5 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,15 @@
<!-- SDK dependencies -->
<MicrosoftDotNetApiCompatTaskVersion>9.0.100-alpha.1.23425.9</MicrosoftDotNetApiCompatTaskVersion>
<!-- Arcade dependencies -->
<MicrosoftDotNetBuildTasksFeedVersion>8.0.0-beta.23411.1</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetCodeAnalysisVersion>8.0.0-beta.23411.1</MicrosoftDotNetCodeAnalysisVersion>
<MicrosoftDotNetGenAPIVersion>8.0.0-beta.23411.1</MicrosoftDotNetGenAPIVersion>
<MicrosoftDotNetGenFacadesVersion>8.0.0-beta.23411.1</MicrosoftDotNetGenFacadesVersion>
<MicrosoftDotNetBuildTasksFeedVersion>8.0.0-beta.23422.1</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetCodeAnalysisVersion>8.0.0-beta.23422.1</MicrosoftDotNetCodeAnalysisVersion>
<MicrosoftDotNetGenAPIVersion>8.0.0-beta.23422.1</MicrosoftDotNetGenAPIVersion>
<MicrosoftDotNetGenFacadesVersion>8.0.0-beta.23422.1</MicrosoftDotNetGenFacadesVersion>
<MicrosoftDotNetXUnitAssertVersion>8.0.0-beta.23422.1</MicrosoftDotNetXUnitAssertVersion>
<MicrosoftDotNetXUnitExtensionsVersion>8.0.0-beta.23422.1</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftDotNetXUnitConsoleRunnerVersion>2.5.1-beta.23422.1</MicrosoftDotNetXUnitConsoleRunnerVersion>
<MicrosoftDotNetBuildTasksArchivesVersion>8.0.0-beta.23422.1</MicrosoftDotNetBuildTasksArchivesVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,15 @@
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" Version="$(MicrosoftDotNetXUnitExtensionsVersion)" />
<PackageReference Include="xunit.core" Version="$(XUnitVersion)" ExcludeAssets="build" />
<PackageReference Include="xunit.assert" Version="$(XUnitVersion)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<!-- Upgrade the NetStandard.Library transitive xunit dependency to avoid 1.x NS dependencies. -->
<PackageReference Include="NETStandard.Library" Version="$(NetStandardLibraryVersion)" />
<!-- Use the arcade fork of xunit.assert for AOT-compat -->
<PackageReference Include="Microsoft.DotNet.XUnitAssert" Version="$(MicrosoftDotNetXUnitAssertVersion)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
<PackageReference Include="xunit.assert" Version="$(XUnitVersion)" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions src/libraries/System.Linq.Expressions/tests/default.rd.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<Type Name="System.Collections.Generic.List`1" Dynamic="Required All" />
</Assembly>

<Assembly Name="Xunit.Assert">
<Type Name="Xunit.Assert" Dynamic="Required All" />
</Assembly>

<Assembly Name="System.Runtime">
<Type Name="System.Decimal" Dynamic="Required All" />
<Type Name="System.DateTimeOffset" Dynamic="Required All" />
Expand Down
3 changes: 3 additions & 0 deletions src/libraries/System.Runtime/tests/System/ArrayTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Microsoft.DotNet.XUnitExtensions;
using Xunit;
using Xunit.Abstractions;
Expand Down Expand Up @@ -4299,6 +4300,8 @@ public class Bar : IEquatable<Bar>
public string Value { get; set; }

public bool Equals(Bar other) => string.Equals(Value, other.Value);
public override bool Equals(object other) => Equals(other as Bar);
public override int GetHashCode() => Value.GetHashCode();
}

public class Foo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ public void SerializeHashSet()

string json = JsonSerializer.Serialize(data, s_indentedOption);

ImmutableHashSet<string> a = JsonSerializer.Deserialize<ImmutableHashSet<string>>(json);
// Use ISet to disambiguate between ISet and IReadOnlySet overloads below
ISet<string> a = JsonSerializer.Deserialize<ImmutableHashSet<string>>(json);
Assert.Equal(3, a.Count);
Assert.Contains("One", a);
Assert.Contains("II", a);
Expand All @@ -266,7 +267,8 @@ public void DeserializeHashSet()
""3""
]";

ImmutableHashSet<string> data = JsonSerializer.Deserialize<ImmutableHashSet<string>>(json);
// Use ISet to disambiguate between ISet and IReadOnlySet overloads below
ISet<string> data = JsonSerializer.Deserialize<ImmutableHashSet<string>>(json);

Assert.Equal(3, data.Count);
Assert.Contains("3", data);
Expand Down Expand Up @@ -316,7 +318,8 @@ public void DeserializeSortedSet()
""3""
]";

ImmutableSortedSet<string> data = JsonSerializer.Deserialize<ImmutableSortedSet<string>>(json);
// Use ISet to disambiguate between ISet and IReadOnlySet overloads below
ISet<string> data = JsonSerializer.Deserialize<ImmutableSortedSet<string>>(json);

Assert.Equal(3, data.Count);
Assert.Contains("3", data);
Expand Down