using System; using System.Collections.Generic; using System.Net.NetworkInformation; using Xunit; using System.Linq; public abstract class BaseReturnDoubleArrayFsharpTests : PlDotNetTest { protected abstract string FunctionBody { get; } protected abstract LanguageType Language { get; } public BaseReturnDoubleArrayFsharpTests() { FunctionInfo = new SqlFunctionInfo { Name = "ReturnDoubleArrayFsharp", Arguments = new List { new FunctionArgument("doubles", "float8[]") }, ReturnType = "float8[]", Body = FunctionBody, Language = Language, IsStrict = true, }; } public static object[][] TestCases() { return new object[][] { new object[] { "f#-float8-null-1array", "returnDoubleArrayFSharp1", "ARRAY[21.0000000000109::float8, null::float8, 4.521234313421::float8, 7.412344328978::float8]", "= ARRAY[21.0000000000109::float8, null::float8, 4.521234313421::float8, 7.412344328978::float8]" }, new object[] { "f#-float8-null-2array-arraynull", "returnDoubleArrayFSharp2", "ARRAY[[null::float8, null::float8], [4.521234313421::float8, 7.412344328978::float8]]", "= ARRAY[[null::float8, null::float8], [4.521234313421::float8, 7.412344328978::float8]]" }, }; } [Theory] [MemberData(nameof(TestCases))] public void TestReturnDoubleArrayFsharp(string featureName, string testName, string input, string expectedResult) { RunGenericTest(featureName, testName, input, expectedResult); } } [Trait("Language", "FSharp")] [Trait("Category", "Floats")] public class ReturnDoubleArrayFsharpTestsFSharp : BaseReturnDoubleArrayFsharpTests { protected override string FunctionBody => @" doubles "; protected override LanguageType Language => LanguageType.PlfSharp; }