[Fixes #924] Correct RightShiftAssign operator

This commit is contained in:
Ajay Bhargav Baaskaran 2017-02-15 11:21:11 -08:00
parent 4fd441ae35
commit 4b2245eeb9
4 changed files with 43 additions and 2 deletions

View File

@ -58,7 +58,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Legacy
{ CSharpSymbolType.GreaterThan, ">" },
{ CSharpSymbolType.GreaterThanEqual, ">=" },
{ CSharpSymbolType.RightShift, ">>" },
{ CSharpSymbolType.RightShiftAssign, ">>>" },
{ CSharpSymbolType.RightShiftAssign, ">>=" },
{ CSharpSymbolType.Hash, "#" },
{ CSharpSymbolType.Transition, "@" },
};

View File

@ -61,7 +61,7 @@ namespace Microsoft.AspNetCore.Razor.Parser
{ CSharpSymbolType.GreaterThan, ">" },
{ CSharpSymbolType.GreaterThanEqual, ">=" },
{ CSharpSymbolType.RightShift, ">>" },
{ CSharpSymbolType.RightShiftAssign, ">>>" },
{ CSharpSymbolType.RightShiftAssign, ">>=" },
{ CSharpSymbolType.Hash, "#" },
{ CSharpSymbolType.Transition, "@" },
};

View File

@ -0,0 +1,20 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Xunit;
namespace Microsoft.AspNetCore.Razor.Evolution.Legacy
{
public class CSharpLanguageCharacteristicsTest
{
[Fact]
public void GetSample_RightShiftAssign_ReturnsCorrectSymbol()
{
// Arrange & Act
var symbol = CSharpLanguageCharacteristics.Instance.GetSample(CSharpSymbolType.RightShiftAssign);
// Assert
Assert.Equal(">>=", symbol);
}
}
}

View File

@ -0,0 +1,21 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Razor.Tokenizer.Symbols;
using Xunit;
namespace Microsoft.AspNetCore.Razor.Parser
{
public class CSharpLanguageCharacteristicsTest
{
[Fact]
public void GetSymbolSample_RightShiftAssign_ReturnsCorrectSymbol()
{
// Arrange & Act
var symbol = CSharpLanguageCharacteristics.GetSymbolSample(CSharpSymbolType.RightShiftAssign);
// Assert
Assert.Equal(">>=", symbol);
}
}
}