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

.NET 8対応 #149

Merged
merged 1 commit into from
Sep 3, 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 Source/Utf8Utility/Utf8ArrayDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@ public Utf8ArrayDictionary()
/// <param name="capacity">格納できる要素数の初期値</param>
public Utf8ArrayDictionary(int capacity)
{
#if NET8_0_OR_GREATER
ArgumentOutOfRangeException.ThrowIfNegative(capacity);
#else
if (capacity < 0)
{
ThrowHelper.ThrowArgumentOutOfRangeException(nameof(capacity));
}
#endif

if (capacity < 2)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Utf8Utility/Utf8Utility.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net6.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0;netstandard2.1</TargetFrameworks>
<IsPackable>true</IsPackable>
</PropertyGroup>

Expand Down
4 changes: 4 additions & 0 deletions Tests/Utf8Utility.Tests/Helpers/StringHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ sealed class StringHelper
/// <exception cref="ArgumentOutOfRangeException">文字数に0以下が指定された場合、この例外をスローします。</exception>
public static string GetAsciiRandomString(int length)
{
#if NET8_0_OR_GREATER
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(length);
#else
if (length <= 0)
{
throw new ArgumentOutOfRangeException(nameof(length));
}
#endif

var buffer = new byte[length];

Expand Down
2 changes: 1 addition & 1 deletion Tests/Utf8Utility.Tests/Utf8Utility.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down