Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vdoc: improve creation of trimmed node descriptions, extend tests (#2…
- Loading branch information
Showing
5 changed files
with
46 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module main | ||
|
||
fn test_trim_doc_node_description() { | ||
mod := 'foo' | ||
mut readme := '## Description | ||
`foo` is a module that provides tools and utility functions to assist in working with bar. | ||
It also assists with composing and testing baz.' | ||
expected := 'is a module that provides tools and utility functions to assist in working with' | ||
res := trim_doc_node_description(mod, readme).trim_space() | ||
assert res == expected | ||
|
||
readme = '# Foo | ||
`foo` is a module that provides tools and utility functions to assist in working with bar. | ||
It also assists with composing and testing baz.' | ||
res2 := trim_doc_node_description(mod, readme).trim_space() | ||
assert res2 == res | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters