File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ applies_to:
24
24
"""
25
25
[<Fact>]
26
26
let ``apply matches expected`` () =
27
- markdown |> appliesTo ( Unchecked.defaultof< ApplicableTo>)
27
+ markdown |> appliesTo Unchecked.defaultof< ApplicableTo>
28
28
29
29
type ``apply default to top level arguments`` () =
30
30
static let markdown = frontMatter """
@@ -212,7 +212,7 @@ applies_to:
212
212
"""
213
213
[<Fact>]
214
214
let ``does not render label`` () =
215
- markdown |> appliesTo ( Unchecked.defaultof< ApplicableTo>)
215
+ markdown |> appliesTo Unchecked.defaultof< ApplicableTo>
216
216
217
217
type ``parses applies_to with multiple categories in any order`` () =
218
218
static let markdown = frontMatter """
Original file line number Diff line number Diff line change @@ -27,17 +27,19 @@ module MarkdownDocumentAssertions =
27
27
unsupportedBlocks
28
28
29
29
[<DebuggerStepThrough>]
30
- let appliesTo ( expectedAvailability : ApplicableTo ) ( actual : Lazy < GeneratorResults >) =
30
+ let appliesTo ( expectedAvailability : ApplicableTo | null ) ( actual : Lazy < GeneratorResults >) =
31
31
let actual = actual.Value
32
32
let result = actual.MarkdownResults |> Seq.find ( fun r -> r.File.RelativePath = " index.md" )
33
33
let matter = result.File.YamlFrontMatter
34
34
match matter with
35
35
| NonNull m ->
36
- if expectedAvailability <> null then
37
- m.AppliesTo.Diagnostics <- expectedAvailability.Diagnostics
36
+ match expectedAvailability with
37
+ | NonNull a -> m.AppliesTo.Diagnostics <- a.Diagnostics
38
+ | _ -> ()
39
+
38
40
let apply = m.AppliesTo
39
41
test <@ apply = expectedAvailability @>
40
- | _ -> failwithf " %s has no yamlfront matter" result.File.RelativePath
42
+ | _ -> failwithf $ " %s {result.File.RelativePath} has no yamlfront matter"
41
43
42
44
43
45
[<DebuggerStepThrough>]
You can’t perform that action at this time.
0 commit comments