Skip to content

Commit

Permalink
49936 text json failures (dotnet#68758)
Browse files Browse the repository at this point in the history
* dotnet#49936 fixed text json failures and enabled System.Text.Json\tests
  • Loading branch information
mkhamoyan authored May 10, 2022
1 parent 97622df commit 43dd0a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,16 @@ private static void RunAsRootTypeTest<T>(List<T> numbers)

private static string GetNumberAsString<T>(T number)
{
// Took out float case from switch due to nan conversion
// There is active issue https://github.com/dotnet/runtime/issues/68906 on x86 Android
if (number is float)
{
return ((float)(object)number).ToString(JsonTestHelper.SingleFormatString, CultureInfo.InvariantCulture);
}

return number switch
{
double @double => @double.ToString(JsonTestHelper.DoubleFormatString, CultureInfo.InvariantCulture),
float @float => @float.ToString(JsonTestHelper.SingleFormatString, CultureInfo.InvariantCulture),
decimal @decimal => @decimal.ToString(CultureInfo.InvariantCulture),
_ => number.ToString()
};
Expand Down Expand Up @@ -359,7 +365,6 @@ public class Class_With_ListsOfBoxedNonNumbers
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/49936", TestPlatforms.Android)]
public static void Number_AsCollectionElement_RoundTrip()
{
RunAsCollectionElementTest(JsonNumberTestData.Bytes);
Expand Down Expand Up @@ -986,7 +991,6 @@ private static void AssertUnsupportedFormatThrows<T>()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/49936", TestPlatforms.Android)]
public static void EscapingTest()
{
// Cause all characters to be escaped.
Expand Down
3 changes: 0 additions & 3 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@
<!-- https://github.com/dotnet/runtime/issues/50926 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Diagnostics.Tracing\tests\System.Diagnostics.Tracing.Tests.csproj" />

<!-- https://github.com/dotnet/runtime/issues/49936 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.Tests\System.Text.Json.Tests.csproj" />

<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Http\tests\FunctionalTests\System.Net.Http.Functional.Tests.csproj" />

<!-- Execution may be compromised -->
Expand Down

0 comments on commit 43dd0a7

Please sign in to comment.