Browse Source

Xor operator now converted to python correctly.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4259 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 17 years ago
parent
commit
c487ec1948
  1. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/NRefactoryToPythonConverter.cs
  2. 8
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/BinaryOperatorConversionTests.cs

2
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/NRefactoryToPythonConverter.cs

@ -195,6 +195,8 @@ namespace ICSharpCode.PythonBinding @@ -195,6 +195,8 @@ namespace ICSharpCode.PythonBinding
return "and";
case BinaryOperatorType.LogicalOr:
return "or";
case BinaryOperatorType.ExclusiveOr:
return "^";
case BinaryOperatorType.Modulus:
return "%";
case BinaryOperatorType.Multiply:

8
src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/BinaryOperatorConversionTests.cs

@ -115,6 +115,12 @@ namespace PythonBinding.Tests.Converter @@ -115,6 +115,12 @@ namespace PythonBinding.Tests.Converter
{
Assert.AreEqual("or", NRefactoryToPythonConverter.GetBinaryOperator(BinaryOperatorType.LogicalOr));
}
[Test]
public void BooleanXor()
{
Assert.AreEqual("^", NRefactoryToPythonConverter.GetBinaryOperator(BinaryOperatorType.ExclusiveOr));
}
[Test]
public void Modulus()
@ -151,7 +157,7 @@ namespace PythonBinding.Tests.Converter @@ -151,7 +157,7 @@ namespace PythonBinding.Tests.Converter
{
Assert.AreEqual("<<", NRefactoryToPythonConverter.GetBinaryOperator(BinaryOperatorType.ShiftLeft));
}
/// <summary>
/// Gets the C# code with the binary operator replaced with the
/// specified string.

Loading…
Cancel
Save