mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-22 17:24:07 -05:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
|
||||
<DebugType>portable</DebugType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Localization\transXliff\" />
|
||||
|
||||
@@ -40,4 +40,4 @@ using System.Runtime.InteropServices;
|
||||
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.IntegrationTests")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.Test.Common")]
|
||||
[assembly: InternalsVisibleTo("MicrosoftSqlToolsServiceLayer")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ManagedBatchParser.UnitTests")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ManagedBatchParser.IntegrationTests")]
|
||||
Reference in New Issue
Block a user