From 9853bffbf6b481df858cc28fc07dff201217b5b3 Mon Sep 17 00:00:00 2001 From: Paul Irwin Date: Sat, 18 Jan 2025 11:29:19 -0700 Subject: [PATCH] Revert test code to use extension method --- .../Support/ExceptionHandling/TestExceptionExtensions.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Lucene.Net.Tests.AllProjects/Support/ExceptionHandling/TestExceptionExtensions.cs b/src/Lucene.Net.Tests.AllProjects/Support/ExceptionHandling/TestExceptionExtensions.cs index 469287a8c5..862db3661a 100644 --- a/src/Lucene.Net.Tests.AllProjects/Support/ExceptionHandling/TestExceptionExtensions.cs +++ b/src/Lucene.Net.Tests.AllProjects/Support/ExceptionHandling/TestExceptionExtensions.cs @@ -7,6 +7,10 @@ using System.Linq; using Assert = Lucene.Net.TestFramework.Assert; +#if !FEATURE_STRING_CONTAINS_STRINGCOMPARISON +using Lucene.Net.Support.Text; +#endif + namespace Lucene.Net.Support.ExceptionHandling { /* @@ -405,7 +409,7 @@ public void TestPrintStackTrace() e.PrintStackTrace(sw); } - var str = sw.ToString().AsSpan(); + var str = sw.ToString(); Assert.IsTrue(str.Contains(typeof(MyException).FullName!, StringComparison.Ordinal)); Assert.IsTrue(str.Contains("Test exception", StringComparison.Ordinal)); @@ -435,7 +439,7 @@ public void TestPrintStackTrace_WithSuppressed() e.PrintStackTrace(sw); } - var str = sw.ToString().AsSpan(); + var str = sw.ToString(); Assert.IsTrue(str.Contains(typeof(MyException).FullName!, StringComparison.Ordinal)); Assert.IsTrue(str.Contains("Test exception", StringComparison.Ordinal));