mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
Make nullable warnings a per file opt-in (#1842)
* Make nullable warnings a per file opt-in * Remove unneeded compiler directives * Remove compiler directive for User Data
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
@@ -67,14 +69,14 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.UtilityTests
|
||||
Assert.AreEqual(cell.RawObject, long.Parse(output));
|
||||
}
|
||||
|
||||
private static readonly object[] decimalTypes =
|
||||
{
|
||||
private static readonly object[] decimalTypes =
|
||||
{
|
||||
new object[] {"MONEY", "MONEY", null, null },
|
||||
new object[] {"SMALLMONEY", "SMALLMONEY", null, null },
|
||||
new object[] {"NUMERIC", @"NUMERIC\(\d+, \d+\)", 18, 0},
|
||||
new object[] {"DECIMAL", @"DECIMAL\(\d+, \d+\)", 18, 0 },
|
||||
};
|
||||
|
||||
new object[] {"DECIMAL", @"DECIMAL\(\d+, \d+\)", 18, 0 },
|
||||
};
|
||||
|
||||
[Test, TestCaseSource(nameof(decimalTypes))]
|
||||
public void DecimalTest(string dataType, string regex, int? precision, int? scale)
|
||||
{
|
||||
@@ -260,13 +262,13 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.UtilityTests
|
||||
Assert.Throws<ArgumentNullException>(() => ToSqlScript.FormatIdentifier(null));
|
||||
}
|
||||
|
||||
private static readonly object[] bracketEscapes =
|
||||
{
|
||||
private static readonly object[] bracketEscapes =
|
||||
{
|
||||
new object[] {"test", "[test]" }, // No escape characters
|
||||
new object[] {"]test", "[]]test]" }, // Escape character at beginning
|
||||
new object[] {"te]st", "[te]]st]" }, // Escape character in middle
|
||||
new object[] {"test]", "[test]]]" }, // Escape character at end
|
||||
new object[] {"t]]est", "[t]]]]est]" }, // Multiple escape characters
|
||||
new object[] {"t]]est", "[t]]]]est]" }, // Multiple escape characters
|
||||
};
|
||||
|
||||
[Test, TestCaseSource(nameof(bracketEscapes))]
|
||||
@@ -279,12 +281,12 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.UtilityTests
|
||||
Assert.AreEqual(expectedOutput, output);
|
||||
}
|
||||
|
||||
private static readonly object[] multiParts =
|
||||
{
|
||||
private static readonly object[] multiParts =
|
||||
{
|
||||
new object[] {"test", "[test]" }, // No splits, no escape characters
|
||||
new object[] {"test.test", "[test].[test]" }, // One split, no escape characters
|
||||
new object[] {"test.te]st", "[test].[te]]st]" }, // One split, one escape character
|
||||
new object[] {"test.test.test", "[test].[test].[test]" }, // Two splits, no escape characters
|
||||
new object[] {"test.test.test", "[test].[test].[test]" }, // Two splits, no escape characters
|
||||
};
|
||||
|
||||
[Test, TestCaseSource(nameof(multiParts))]
|
||||
|
||||
Reference in New Issue
Block a user