Skip to content

Commit

Permalink
Fix #2423: Coverlet: don't use implicit yield (#2424)
Browse files Browse the repository at this point in the history
Fix #2423: Coverlet: don't use implicit yield
  • Loading branch information
matthid authored Nov 2, 2019
2 parents cd7d749 + 8dc6c42 commit 4bc0f2e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
24 changes: 12 additions & 12 deletions src/app/Fake.DotNet.Testing.Coverlet/Coverlet.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
10 changes: 6 additions & 4 deletions src/test/Fake.Core.UnitTests/Fake.DotNet.Testing.Coverlet.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
]

0 comments on commit 4bc0f2e

Please sign in to comment.