Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/NRefactory.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Grunwald <daniel@danielgrunwald.de>2016-06-26 16:30:15 +0300
committerDaniel Grunwald <daniel@danielgrunwald.de>2016-06-26 16:30:15 +0300
commit1463cf299d05a80d1056ad6608c375688629f006 (patch)
tree1d7264ac7cfc1bba2f05ccd2b585cde93e1acc9a
parent8cf15ccebee89d589fbc23fbe61fcc9ff1878a67 (diff)
Don't make the compiler evaluate the expected result using compile-time constant folding -- the Mono C# compiler gets this wrong.
-rw-r--r--ICSharpCode.NRefactory.Tests/CSharp/Resolver/BinaryOperatorTests.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/ICSharpCode.NRefactory.Tests/CSharp/Resolver/BinaryOperatorTests.cs b/ICSharpCode.NRefactory.Tests/CSharp/Resolver/BinaryOperatorTests.cs
index 520bc189..3e78edd3 100644
--- a/ICSharpCode.NRefactory.Tests/CSharp/Resolver/BinaryOperatorTests.cs
+++ b/ICSharpCode.NRefactory.Tests/CSharp/Resolver/BinaryOperatorTests.cs
@@ -193,12 +193,15 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver
AssertConstant(StringComparison.InvariantCulture, resolver.ResolveBinaryOperator(
BinaryOperatorType.Subtract, MakeConstant(StringComparison.InvariantCulture), MakeConstant(0)));
- AssertConstant(0 - StringComparison.InvariantCulture, resolver.ResolveBinaryOperator(
+ AssertConstant(-2, resolver.ResolveBinaryOperator(
BinaryOperatorType.Subtract, MakeConstant(0), MakeConstant(StringComparison.InvariantCulture)));
- AssertConstant(1 - StringComparison.InvariantCulture, resolver.ResolveBinaryOperator(
+ AssertConstant((StringComparison)(-1), resolver.ResolveBinaryOperator(
BinaryOperatorType.Subtract, MakeConstant(1), MakeConstant(StringComparison.InvariantCulture)));
+ AssertConstant(-2, resolver.ResolveBinaryOperator(
+ BinaryOperatorType.Subtract, MakeConstant(0L), MakeConstant(StringComparison.InvariantCulture)));
+
TestOperator(MakeResult(typeof(StringComparison?)), BinaryOperatorType.Subtract, MakeResult(typeof(int)),
Conversion.IdentityConversion, Conversion.ImplicitNullableConversion, typeof(StringComparison?));