From 2e9e4572ed23a5bf8de7b9e00fc2a51232640adc Mon Sep 17 00:00:00 2001 From: Loic Denuziere Date: Wed, 30 Oct 2019 00:18:27 +0100 Subject: [PATCH 1/2] Coverlet: don't use implicit yield --- .../Fake.DotNet.Testing.Coverlet/Coverlet.fs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/app/Fake.DotNet.Testing.Coverlet/Coverlet.fs b/src/app/Fake.DotNet.Testing.Coverlet/Coverlet.fs index 0eae906531a..a805ba7353e 100644 --- a/src/app/Fake.DotNet.Testing.Coverlet/Coverlet.fs +++ b/src/app/Fake.DotNet.Testing.Coverlet/Coverlet.fs @@ -89,28 +89,28 @@ let withMSBuildArguments (param: CoverletParams -> CoverletParams) (args: MSBuil let param = param defaults let properties = [ - "CollectCoverage", "true" - "OutputFormat", outputFormatToString param.OutputFormat - "CoverletOutput", param.Output + yield "CollectCoverage", "true" + yield "OutputFormat", outputFormatToString param.OutputFormat + yield "CoverletOutput", param.Output if not (List.isEmpty param.Include) then - "Include", namespacesToString param.Include + yield "Include", namespacesToString param.Include if not (List.isEmpty param.Exclude) then - "Exclude", namespacesToString param.Exclude + yield "Exclude", namespacesToString param.Exclude if not (List.isEmpty param.ExcludeByAttribute) then - "ExcludeByAttribute", String.concat "," param.ExcludeByAttribute + yield "ExcludeByAttribute", String.concat "," param.ExcludeByAttribute if not (List.isEmpty param.ExcludeByFile) then - "ExcludeByFile", String.concat "," param.ExcludeByFile + yield "ExcludeByFile", String.concat "," param.ExcludeByFile match param.MergeWith with - | Some f -> "MergeWith", f + | Some f -> yield "MergeWith", f | None -> () match param.Threshold with | Some t -> - "Threshold", string t - "ThresholdType", thresholdTypeToString param.ThresholdType - "ThresholdStat", thresholdStatToString param.ThresholdStat + yield "Threshold", string t + yield "ThresholdType", thresholdTypeToString param.ThresholdType + yield "ThresholdStat", thresholdStatToString param.ThresholdStat | None -> () if param.UseSourceLink then - "UseSourceLink", "true" + yield "UseSourceLink", "true" ] { args with Properties = args.Properties @ properties } From 8dc6c42b84742ac02b3c8c29803a0bdf15346f9f Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Fri, 1 Nov 2019 22:04:29 +0100 Subject: [PATCH 2/2] fix test code --- .../Fake.DotNet.Testing.Coverlet.fs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/test/Fake.Core.UnitTests/Fake.DotNet.Testing.Coverlet.fs b/src/test/Fake.Core.UnitTests/Fake.DotNet.Testing.Coverlet.fs index 196cb9897bc..8c578665357 100644 --- a/src/test/Fake.Core.UnitTests/Fake.DotNet.Testing.Coverlet.fs +++ b/src/test/Fake.Core.UnitTests/Fake.DotNet.Testing.Coverlet.fs @@ -34,7 +34,8 @@ let tests = ThresholdStat = Coverlet.ThresholdStat.Total UseSourceLink = true }) - Expect.containsAll [ + Expect.isTrue (props.Length > 0) "Result should contain some elements" + Expect.containsAll props [ "CollectCoverage", "true" "CoverletOutput", "coverage.json" "OutputFormat", "cobertura" @@ -47,13 +48,14 @@ let tests = "ThresholdType", "branch" "ThresholdStat", "total" "UseSourceLink", "true" - ] props "expected proper MSBuild properties" + ] "expected proper MSBuild properties" testCase "Test that default properties are converted" <| fun _ -> let props = getProps id - Expect.containsAll [ + Expect.isTrue (props.Length > 0) "Result should contain some elements" + Expect.containsAll props [ "CollectCoverage", "true" "CoverletOutput", "./" "OutputFormat", "json" - ] props "expected proper MSBuild properties" + ] "expected proper MSBuild properties" ]