Skip to content

Commit

Permalink
Use .NET 9 SDK, update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
teo-tsirpanis authored and Sergio0694 committed Nov 19, 2024
1 parent c7f62f1 commit 13b94a1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>12.0</LangVersion>
<LangVersion>13.0</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"version": "8.0.100",
"version": "9.0.100",
"rollForward": "latestFeature",
"allowPrerelease": false
}
}
}
29 changes: 27 additions & 2 deletions tests/PolySharp.Tests/LanguageFeatures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,18 @@ public static ReadOnlySpan<int> TestRange(ReadOnlySpan<int> numbers)
[CollectionBuilder(typeof(CollectionClass), nameof(Create))]
internal class CollectionClass : IEnumerable<int>
{
public CollectionClass Test()
public static CollectionClass Test()
{
Test2(1, 2, 3);

return [1, 2, 3];
}

public static void Test2(params CollectionClass collection)
{

}

public static CollectionClass Create(ReadOnlySpan<int> values)
{
return new();
Expand Down Expand Up @@ -260,4 +267,22 @@ public void Start<TStateMachine>(ref TStateMachine stateMachine)
}
}

#endif
#endif

internal static class OverloadResolutionPriorityTests
{
public static void Test()
{
TestOverload(1);
}

[Obsolete("Do not use", error: true)]
[OverloadResolutionPriority(-1)]
public static void TestOverload(int x)
{
}

public static void TestOverload(int x, int y = 0)
{
}
}
2 changes: 1 addition & 1 deletion tests/PolySharp.Tests/PolySharp.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net48;netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net472;net48;netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<PolySharpIncludeRuntimeSupportedAttributes>true</PolySharpIncludeRuntimeSupportedAttributes>
</PropertyGroup>

Expand Down

0 comments on commit 13b94a1

Please sign in to comment.