You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2022/11/21 08:53:22 UTC

[lucenenet] 02/08: Fixed a couple of minor issues for net7.0 that were causing test failures. These were basically bug fixes that weren't accounted for by our tests.

This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit 7bdc262b47cd05692846068af8177702697ae343
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Sat Nov 19 14:59:42 2022 +0700

    Fixed a couple of minor issues for net7.0 that were causing test failures. These were basically bug fixes that weren't accounted for by our tests.
---
 .../Support/ExceptionHandling/ExceptionScanningTestCase.cs         | 1 +
 src/Lucene.Net.Tests.Expressions/JS/TestCustomFunctions.cs         | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/Lucene.Net.Tests.AllProjects/Support/ExceptionHandling/ExceptionScanningTestCase.cs b/src/Lucene.Net.Tests.AllProjects/Support/ExceptionHandling/ExceptionScanningTestCase.cs
index 9c51aaeb0..408edca1c 100644
--- a/src/Lucene.Net.Tests.AllProjects/Support/ExceptionHandling/ExceptionScanningTestCase.cs
+++ b/src/Lucene.Net.Tests.AllProjects/Support/ExceptionHandling/ExceptionScanningTestCase.cs
@@ -352,6 +352,7 @@ namespace Lucene.Net.Support.ExceptionHandling
                 typeof(OverflowException), // Subclasses ArithmeticException, so probably okay
                 typeof(PlatformNotSupportedException),
                 typeof(RankException),
+                typeof(System.ComponentModel.Win32Exception), // Added for .NET 7 (not sure why, this is an old exception)
                 typeof(System.Reflection.CustomAttributeFormatException), // Maybe like AnnotationTypeMismatchException in Java...?
                 typeof(System.Resources.MissingSatelliteAssemblyException),
                 //typeof(System.Runtime.CompilerServices.SwitchExpressionException), // .NET Standard 2.1+ only (conditionally added below)
diff --git a/src/Lucene.Net.Tests.Expressions/JS/TestCustomFunctions.cs b/src/Lucene.Net.Tests.Expressions/JS/TestCustomFunctions.cs
index 9ca94881c..00b84947a 100644
--- a/src/Lucene.Net.Tests.Expressions/JS/TestCustomFunctions.cs
+++ b/src/Lucene.Net.Tests.Expressions/JS/TestCustomFunctions.cs
@@ -237,7 +237,12 @@ namespace Lucene.Net.Expressions.JS
                 StringWriter sw = new StringWriter();
                 e.printStackTrace();
                 //.NET Port
-                Assert.IsTrue(e.StackTrace.Contains("Lucene.Net.Expressions.CompiledExpression.Evaluate(Int32 , FunctionValues[] )"));
+                Assert.IsTrue(
+                    // LUCENENET: Apparently in .NET 7, they finally fixed this weird display issue with spaces before the comma
+                    // and closing parenthesis. It is a pass.
+                    e.StackTrace.Contains("Lucene.Net.Expressions.CompiledExpression.Evaluate(Int32, FunctionValues[])") ||
+                    e.StackTrace.Contains("Lucene.Net.Expressions.CompiledExpression.Evaluate(Int32 , FunctionValues[] )")
+                    );
             }
         }