From ef4c339fb9de87f7534303e006c281e40327f803 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 18 Oct 2022 10:18:44 -0400 Subject: feat(docs): update parser, HTML gen #20720 Note: although the tolerance in help_spec.lua increased, the actual error count with the new parser decreased by about 20%. The difference is that the old ignore_parse_error() ignored many more errors with the old parser. fix https://github.com/neovim/tree-sitter-vimdoc/issues/37 fix https://github.com/neovim/tree-sitter-vimdoc/issues/44 fix https://github.com/neovim/tree-sitter-vimdoc/issues/47 --- test/functional/lua/help_spec.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test/functional/lua/help_spec.lua') diff --git a/test/functional/lua/help_spec.lua b/test/functional/lua/help_spec.lua index 242897336d..f5e67ec636 100644 --- a/test/functional/lua/help_spec.lua +++ b/test/functional/lua/help_spec.lua @@ -19,10 +19,11 @@ describe(':help docs', function() local rv = exec_lua([[return require('scripts.gen_help_html').validate('./build/runtime/doc')]]) -- Check that we actually found helpfiles. ok(rv.helpfiles > 100, '>100 :help files', rv.helpfiles) + eq({}, rv.invalid_links, 'found invalid :help tag links') + eq({}, rv.invalid_urls, 'found invalid URLs in :help docs') -- Check that parse errors did not increase wildly. -- TODO: Fix all parse errors in :help files. - ok(rv.err_count < 100, '<100 parse errors', rv.err_count) - eq({}, rv.invalid_links, exec_lua([[return 'found invalid :help tag links:\n'..vim.inspect(...)]], rv.invalid_links)) + ok(rv.err_count < 350, '<350 parse errors', rv.err_count) end) it('gen_help_html.lua generates HTML', function() @@ -43,7 +44,7 @@ describe(':help docs', function() tmpdir ) eq(4, #rv.helpfiles) - ok(rv.err_count == 0, '0 parse errors', rv.err_count) - eq({}, rv.invalid_links, exec_lua([[return 'found invalid :help tag links:\n'..vim.inspect(...)]], rv.invalid_links)) + ok(rv.err_count < 25, '<25 parse errors', rv.err_count) + eq({}, rv.invalid_links, 'found invalid :help tag links') end) end) -- cgit