Include ManagedBatchParser tests to improve code coverage (#793)

* Include ManagedBatchParser test to improve code coverage

* Fix some failing test cases and revert appveyor.yml
This commit is contained in:
Dhruva N
2019-04-22 17:35:48 -07:00
committed by Karl Burtram
parent 9e14336293
commit e9bf57bc67
24 changed files with 1033 additions and 438 deletions

View File

@@ -238,6 +238,14 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
if (LookaheadTokenType == LexerTokenType.Text)
{
string text = ResolveVariables(LookaheadToken, 0, null);
// This statement originally placed after the for loop, But it moved here, the reason is:
// When passing the long number like 999999999999999999999999, instead of throwing error
// it accept and iterate the loop
bool result = Int32.TryParse(text, out repeatCount);
if (result == false)
{
RaiseError(ErrorCode.InvalidNumber);
}
for (int i = 0; i < text.Length; i++)
{
if (Char.IsDigit(text[i]) == false)
@@ -245,11 +253,6 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
RaiseError(ErrorCode.InvalidNumber);
}
}
bool result = Int32.TryParse(text, out repeatCount);
if (result == false)
{
RaiseError(ErrorCode.InvalidNumber);
}
Accept(LexerTokenType.Text);
AcceptWhitespaceOrComment();
}