add unit test for wrapping

develop
myk002 2022-09-11 13:51:57 -07:00
parent 23994d4f4c
commit 49798f6412
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
1 changed files with 18 additions and 1 deletions

@ -398,8 +398,25 @@ function test.get_entry_short_help()
end end
function test.get_entry_long_help() function test.get_entry_long_help()
local expected = [[
basic
*****
**Tags:** map
**Command:**
"basic"
Documented
basic.
Documented
full help.
]]
expect.eq(expected, h.get_entry_long_help('basic', 13))
-- long help for plugins/commands that have doc files should match the -- long help for plugins/commands that have doc files should match the
-- contents of those files exactly -- contents of those files exactly (test data is already wrapped)
expect.eq(files['hack/docs/docs/tools/hascommands.txt'], expect.eq(files['hack/docs/docs/tools/hascommands.txt'],
h.get_entry_long_help('hascommands')) h.get_entry_long_help('hascommands'))
expect.eq(files['hack/docs/docs/tools/hascommands.txt'], expect.eq(files['hack/docs/docs/tools/hascommands.txt'],