Skip to content

Commit

Permalink
Revert test code to use extension method
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirwin committed Jan 18, 2025
1 parent 8b47769 commit 9853bff
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/*
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 9853bff

Please sign in to comment.