diff --git a/.build/dependencies.props b/.build/dependencies.props index c2c3ce6abb..5c1124752d 100644 --- a/.build/dependencies.props +++ b/.build/dependencies.props @@ -20,7 +20,8 @@ --> - 3.5.1 + 4.13.1 + 12.8.0 - - + + @@ -68,4 +63,12 @@ + + + true + false + Lucene.Net.Expressions.JS + + + diff --git a/src/Lucene.Net.TestFramework/Support/ApiScanTestBase.cs b/src/Lucene.Net.TestFramework/Support/ApiScanTestBase.cs index bb5ac1fd75..99b0d359a6 100644 --- a/src/Lucene.Net.TestFramework/Support/ApiScanTestBase.cs +++ b/src/Lucene.Net.TestFramework/Support/ApiScanTestBase.cs @@ -1,5 +1,6 @@ using Lucene.Net.Support; using System; +using System.CodeDom.Compiler; using System.Collections.Generic; using System.Linq; using System.Reflection; @@ -407,7 +408,7 @@ private static IEnumerable GetInvalidPrivateFields(Assembly assembly, st { var result = new List(); - var classes = assembly.GetTypes().Where(t => t.IsClass); + var classes = GetTypesToTest(assembly).Where(t => t.IsClass); foreach (var c in classes) { @@ -443,7 +444,7 @@ private static IEnumerable GetInvalidProtectedFields(Assembly assembly) { var result = new List(); - var classes = assembly.GetTypes().Where(t => t.IsClass); + var classes = GetTypesToTest(assembly).Where(t => t.IsClass); foreach (var c in classes) { @@ -489,7 +490,7 @@ private static IEnumerable GetInvalidPublicFields(Assembly assembly, str { var result = new List(); - var classes = assembly.GetTypes().Where(t => t.IsClass && !t.HasAttribute(inherit: false)); + var classes = GetTypesToTest(assembly).Where(t => t.IsClass); foreach (var c in classes) { @@ -535,7 +536,7 @@ private static IEnumerable GetInvalidMethodParameterNames(Assembly assem { var result = new List(); - var classes = assembly.GetTypes().Where(t => t.IsClass); + var classes = GetTypesToTest(assembly).Where(t => t.IsClass); foreach (var c in classes) { @@ -567,7 +568,7 @@ private static IEnumerable GetInvalidInterfaceNames(Assembly assembly) { var result = new List(); - var interfaces = assembly.GetTypes().Where(t => t.IsInterface); + var interfaces = GetTypesToTest(assembly).Where(t => t.IsInterface); foreach (var i in interfaces) { @@ -584,7 +585,7 @@ private static IEnumerable GetInvalidClassNames(Assembly assembly) { var result = new List(); - var classes = assembly.GetTypes().Where(t => t.IsClass); + var classes = GetTypesToTest(assembly).Where(t => t.IsClass); foreach (var c in classes) { @@ -611,7 +612,7 @@ private static IEnumerable GetPropertiesWithNoGetter(Assembly assembly) { var result = new List(); - var classes = assembly.GetTypes().Where(t => t.IsClass); + var classes = GetTypesToTest(assembly).Where(t => t.IsClass); foreach (var c in classes) { @@ -633,7 +634,7 @@ private static IEnumerable GetPropertiesThatReturnArray(Assembly assembl { var result = new List(); - var classes = assembly.GetTypes().Where(t => t.IsClass); + var classes = GetTypesToTest(assembly).Where(t => t.IsClass); foreach (var c in classes) { @@ -667,7 +668,7 @@ private static IEnumerable GetProtectedFieldsContainingComparer(Assembly { var result = new List(); - var classes = assembly.GetTypes().Where(t => t.IsClass); + var classes = GetTypesToTest(assembly).Where(t => t.IsClass); foreach (var c in classes) { @@ -699,7 +700,7 @@ private static IEnumerable GetMembersContainingComparer(Assembly assembl { var result = new List(); - var types = assembly.GetTypes(); + var types = GetTypesToTest(assembly); foreach (var t in types) { @@ -737,7 +738,7 @@ private static IEnumerable GetMembersNamedSize(Assembly assembly) { var result = new List(); - var types = assembly.GetTypes(); + var types = GetTypesToTest(assembly); foreach (var t in types) { @@ -772,7 +773,7 @@ private static IEnumerable GetMembersContainingNonNetNumeric(Assembly as { var result = new List(); - var types = assembly.GetTypes(); + var types = GetTypesToTest(assembly); foreach (var t in types) { @@ -816,7 +817,7 @@ private static IEnumerable GetTypesContainingNonNetNumeric(Assembly asse { var result = new List(); - var types = assembly.GetTypes(); + var types = GetTypesToTest(assembly); foreach (var t in types) { @@ -838,7 +839,7 @@ private static IEnumerable GetMethodsThatReturnWritableArray(Assembly as { var result = new List(); - var classes = assembly.GetTypes().Where(t => t.IsClass); + var classes = GetTypesToTest(assembly).Where(t => t.IsClass); foreach (var c in classes) { @@ -892,7 +893,7 @@ private static IEnumerable GetPublicNullableEnumMembers(Assembly assembl { var result = new List(); - var types = assembly.GetTypes(); + var types = GetTypesToTest(assembly); foreach (var t in types) { @@ -1004,7 +1005,7 @@ private static IEnumerable GetMembersAcceptingOrReturningType(Type lookF { var result = new List(); - var types = assembly.GetTypes(); + var types = GetTypesToTest(assembly); foreach (var t in types) { @@ -1105,5 +1106,10 @@ private static IEnumerable GetMembersAcceptingOrReturningType(Type lookF return result.ToArray(); } + + private static IEnumerable GetTypesToTest(Assembly assembly) => + assembly.GetTypes() + .Where(t => !t.HasAttribute(inherit: false) + && !t.HasAttribute(inherit: false)); } } diff --git a/src/Lucene.Net.Tests.Expressions/JS/TestJavascriptOperations.cs b/src/Lucene.Net.Tests.Expressions/JS/TestJavascriptOperations.cs index 2bcea6cc3f..595580a195 100644 --- a/src/Lucene.Net.Tests.Expressions/JS/TestJavascriptOperations.cs +++ b/src/Lucene.Net.Tests.Expressions/JS/TestJavascriptOperations.cs @@ -269,7 +269,7 @@ public virtual void TestBitShiftLeft() AssertEvaluatesTo("4195 << 6", 268480); AssertEvaluatesTo("4195 << 70", 268480); AssertEvaluatesTo("-4195 << 70", -268480); - AssertEvaluatesTo("-15 << 62", 1073741824); + AssertEvaluatesTo("-15 << 62", 4611686018427387904L); } [Test] @@ -295,13 +295,12 @@ public virtual void TestBitShiftRightUnsigned() AssertEvaluatesTo("2 >>> 1", 1); AssertEvaluatesTo("-1 >>> 37", 134217727); AssertEvaluatesTo("-2 >>> 62", 3); - //.NET Port. CLR returns different values for unsigned shift ops - AssertEvaluatesTo("-5 >>> 33", 2147483645); + AssertEvaluatesTo("-5 >>> 33", 2147483647); AssertEvaluatesTo("536960 >>> 7", 4195); AssertEvaluatesTo("16780 >>> 66", 4195); AssertEvaluatesTo("268480 >>> 6", 4195); AssertEvaluatesTo("268480 >>> 70", 4195); - AssertEvaluatesTo("-268480 >>> 102", 67104669); + AssertEvaluatesTo("-268480 >>> 102", 67108863); AssertEvaluatesTo("2147483648 >>> 1", 1073741824); }