From c553ccbd404594bd9f6e3d0c1c9fa985f9edb875 Mon Sep 17 00:00:00 2001 From: Paul Irwin Date: Mon, 22 Jan 2024 08:10:06 -0700 Subject: [PATCH] Add feature for .NET 6+ Random methods and change #if to use it, #259 --- Directory.Build.targets | 1 + src/Lucene.Net.Tests/Util/Fst/Test2BFST.cs | 2 +- src/Lucene.Net.Tests/Util/Test2BPagedBytes.cs | 2 +- src/Lucene.Net.Tests/Util/TestMergedIterator.cs | 2 +- src/Lucene.Net.Tests/Util/TestSetOnce.cs | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 92406f90f8..c39e315ef9 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -26,6 +26,7 @@ $(DefineConstants);FEATURE_SPANFORMATTABLE + $(DefineConstants);FEATURE_RANDOM_NEXTINT64_NEXTSINGLE diff --git a/src/Lucene.Net.Tests/Util/Fst/Test2BFST.cs b/src/Lucene.Net.Tests/Util/Fst/Test2BFST.cs index 598b6dbb2f..ff321b8367 100644 --- a/src/Lucene.Net.Tests/Util/Fst/Test2BFST.cs +++ b/src/Lucene.Net.Tests/Util/Fst/Test2BFST.cs @@ -5,7 +5,7 @@ using Console = Lucene.Net.Util.SystemConsole; using Int64 = J2N.Numerics.Int64; -#if !NET6_0_OR_GREATER +#if !FEATURE_RANDOM_NEXTINT64_NEXTSINGLE using RandomizedTesting.Generators; // for Random.NextInt64 extension method #endif diff --git a/src/Lucene.Net.Tests/Util/Test2BPagedBytes.cs b/src/Lucene.Net.Tests/Util/Test2BPagedBytes.cs index fb769b5ce0..50106c50f4 100644 --- a/src/Lucene.Net.Tests/Util/Test2BPagedBytes.cs +++ b/src/Lucene.Net.Tests/Util/Test2BPagedBytes.cs @@ -4,7 +4,7 @@ using System; using Assert = Lucene.Net.TestFramework.Assert; -#if !NET6_0_OR_GREATER +#if !FEATURE_RANDOM_NEXTINT64_NEXTSINGLE using RandomizedTesting.Generators; // for Random.NextInt64 extension method #endif diff --git a/src/Lucene.Net.Tests/Util/TestMergedIterator.cs b/src/Lucene.Net.Tests/Util/TestMergedIterator.cs index 515902e529..05c63144fb 100644 --- a/src/Lucene.Net.Tests/Util/TestMergedIterator.cs +++ b/src/Lucene.Net.Tests/Util/TestMergedIterator.cs @@ -4,7 +4,7 @@ using JCG = J2N.Collections.Generic; using Assert = Lucene.Net.TestFramework.Assert; -#if !NET6_0_OR_GREATER +#if !FEATURE_RANDOM_NEXTINT64_NEXTSINGLE using RandomizedTesting.Generators; // for Random.NextInt64 extension method #endif diff --git a/src/Lucene.Net.Tests/Util/TestSetOnce.cs b/src/Lucene.Net.Tests/Util/TestSetOnce.cs index e30e1ea5a7..4af4b812c2 100644 --- a/src/Lucene.Net.Tests/Util/TestSetOnce.cs +++ b/src/Lucene.Net.Tests/Util/TestSetOnce.cs @@ -4,7 +4,7 @@ using System.Globalization; using Assert = Lucene.Net.TestFramework.Assert; -#if !NET6_0_OR_GREATER +#if !FEATURE_RANDOM_NEXTINT64_NEXTSINGLE using RandomizedTesting.Generators; // for Random.NextInt64 extension method #endif