From 49798f6412e6f3e1181efe7ad5942365ced9aaad Mon Sep 17 00:00:00 2001 From: myk002 Date: Sun, 11 Sep 2022 13:51:57 -0700 Subject: [PATCH] add unit test for wrapping --- test/library/helpdb.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/test/library/helpdb.lua b/test/library/helpdb.lua index 6c2ef2e9b..96dcbbce0 100644 --- a/test/library/helpdb.lua +++ b/test/library/helpdb.lua @@ -398,8 +398,25 @@ function test.get_entry_short_help() end 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 - -- contents of those files exactly + -- contents of those files exactly (test data is already wrapped) expect.eq(files['hack/docs/docs/tools/hascommands.txt'], h.get_entry_long_help('hascommands')) expect.eq(files['hack/docs/docs/tools/hascommands.txt'],