Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/authoring/Applicability/AppliesToFrontMatter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ applies_to:
"""
[<Fact>]
let ``apply matches expected`` () =
markdown |> appliesTo (Unchecked.defaultof<ApplicableTo>)
markdown |> appliesTo Unchecked.defaultof<ApplicableTo>

type ``apply default to top level arguments`` () =
static let markdown = frontMatter """
Expand Down Expand Up @@ -212,7 +212,7 @@ applies_to:
"""
[<Fact>]
let ``does not render label`` () =
markdown |> appliesTo (Unchecked.defaultof<ApplicableTo>)
markdown |> appliesTo Unchecked.defaultof<ApplicableTo>

type ``parses applies_to with multiple categories in any order`` () =
static let markdown = frontMatter """
Expand Down
10 changes: 6 additions & 4 deletions tests/authoring/Framework/MarkdownDocumentAssertions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,19 @@
unsupportedBlocks

[<DebuggerStepThrough>]
let appliesTo (expectedAvailability: ApplicableTo) (actual: Lazy<GeneratorResults>) =
let appliesTo (expectedAvailability: ApplicableTo | null) (actual: Lazy<GeneratorResults>) =
let actual = actual.Value
let result = actual.MarkdownResults |> Seq.find (fun r -> r.File.RelativePath = "index.md")
let matter = result.File.YamlFrontMatter
match matter with
| NonNull m ->
if expectedAvailability <> null then
m.AppliesTo.Diagnostics <- expectedAvailability.Diagnostics
match expectedAvailability with
| NonNull a -> m.AppliesTo.Diagnostics <- a.Diagnostics

Check warning on line 37 in tests/authoring/Framework/MarkdownDocumentAssertions.fs

View workflow job for this annotation

GitHub Actions / integration

Nullness warning: The types 'ApplicableTo' and 'ApplicableTo | null' do not have compatible nullability.

Check warning on line 37 in tests/authoring/Framework/MarkdownDocumentAssertions.fs

View workflow job for this annotation

GitHub Actions / integration

Nullness warning: The types 'ApplicableTo' and 'ApplicableTo | null' do not have compatible nullability.

Check warning on line 37 in tests/authoring/Framework/MarkdownDocumentAssertions.fs

View workflow job for this annotation

GitHub Actions / integration

Nullness warning: The types 'ApplicableTo' and 'ApplicableTo | null' do not have compatible nullability.

Check warning on line 37 in tests/authoring/Framework/MarkdownDocumentAssertions.fs

View workflow job for this annotation

GitHub Actions / integration

Nullness warning: The types 'ApplicableTo' and 'ApplicableTo | null' do not have compatible nullability.

Check warning on line 37 in tests/authoring/Framework/MarkdownDocumentAssertions.fs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Nullness warning: The types 'ApplicableTo' and 'ApplicableTo | null' do not have compatible nullability.

Check warning on line 37 in tests/authoring/Framework/MarkdownDocumentAssertions.fs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Nullness warning: The types 'ApplicableTo' and 'ApplicableTo | null' do not have compatible nullability.

Check warning on line 37 in tests/authoring/Framework/MarkdownDocumentAssertions.fs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Nullness warning: The types 'ApplicableTo' and 'ApplicableTo | null' do not have compatible nullability.

Check warning on line 37 in tests/authoring/Framework/MarkdownDocumentAssertions.fs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Nullness warning: The types 'ApplicableTo' and 'ApplicableTo | null' do not have compatible nullability.

Check warning on line 37 in tests/authoring/Framework/MarkdownDocumentAssertions.fs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Nullness warning: The types 'ApplicableTo' and 'ApplicableTo | null' do not have compatible nullability.

Check warning on line 37 in tests/authoring/Framework/MarkdownDocumentAssertions.fs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Nullness warning: The types 'ApplicableTo' and 'ApplicableTo | null' do not have compatible nullability.

Check warning on line 37 in tests/authoring/Framework/MarkdownDocumentAssertions.fs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Nullness warning: The types 'ApplicableTo' and 'ApplicableTo | null' do not have compatible nullability.

Check warning on line 37 in tests/authoring/Framework/MarkdownDocumentAssertions.fs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Nullness warning: The types 'ApplicableTo' and 'ApplicableTo | null' do not have compatible nullability.

Check warning on line 37 in tests/authoring/Framework/MarkdownDocumentAssertions.fs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Nullness warning: The types 'ApplicableTo' and 'ApplicableTo | null' do not have compatible nullability.

Check warning on line 37 in tests/authoring/Framework/MarkdownDocumentAssertions.fs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Nullness warning: The types 'ApplicableTo' and 'ApplicableTo | null' do not have compatible nullability.

Check warning on line 37 in tests/authoring/Framework/MarkdownDocumentAssertions.fs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Nullness warning: The types 'ApplicableTo' and 'ApplicableTo | null' do not have compatible nullability.

Check warning on line 37 in tests/authoring/Framework/MarkdownDocumentAssertions.fs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Nullness warning: The types 'ApplicableTo' and 'ApplicableTo | null' do not have compatible nullability.
| _ -> ()

let apply = m.AppliesTo
test <@ apply = expectedAvailability @>
| _ -> failwithf "%s has no yamlfront matter" result.File.RelativePath
| _ -> failwithf $"%s{result.File.RelativePath} has no yamlfront matter"


[<DebuggerStepThrough>]
Expand Down
Loading