Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Add a test case for completion on title name vs title slug #359

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
11 changes: 11 additions & 0 deletions Tests/ComplTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,17 @@ module Candidates =

checkSnapshot (findCandidatesInDoc folder doc2 (Position.Mk(0, 14)))

[<Fact>]
let wiki_CrossHeading_TitleNameVsSlug () =
let d1 =
FakeDoc.Mk(path = "d1.md", contentLines = [| "# Doc Title"; "## Subtitle" |])
// 01234567890123
let d2 = FakeDoc.Mk(path = "d2.md", contentLines = [| "[[Doc Title#]]" |])

let folder = FakeFolder.Mk([ d1; d2 ])

checkSnapshot (findCandidatesInDoc folder d2 (Position.Mk(0, 12)))

[<StoreSnapshotsPerClass>]
module Tags =
let doc1 =
Expand Down
5 changes: 5 additions & 0 deletions Tests/_snapshots/Candidates.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,10 @@
"AutoGenerated": [
"(7,2)-(7,3): #H2 / #H2"
]
},
"wiki_CrossHeading_TitleNameVsSlug": {
"AutoGenerated": [
"(0,2)-(0,12): doc-title#Subtitle / doc-title#Subtitle"
]
}
}
Loading