summaryrefslogtreecommitdiff
path: root/uvim/src/testdir/test_plugin_helptoc.mnv
blob: 3039e7bbba570e4eb7891a288fdbcfdee067079c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
" Test for the HelpTOC package

source util/screendump.mnv

func Test_helptoc_markdown_with_comments()
  CheckScreendump
  let lines =<< trim END
    packadd helptoc
    e Xmarkdown.md
    call append(0, [
          \ '# Heading 1',
          \ '',
          \ 'Some text.',
          \ '',
          \ '```mnv',
          \ '# This is a MNV9Script comment',
          \ 'def MyFunc()',
          \ '  # Another comment',
          \ 'enddef',
          \ '```',
          \ '# Another Heading 1',
          \ '',
          \ '```',
          \ '# This is a comment in a codeblock',
          \ '```',
          \ '# Last Heading 1',
          \ 'and more text'
          \])
  END

  let input_file = "Xhelptoc.mnv"
  call writefile(lines, input_file, "D")

  let buf = RunMNVInTerminal($"-S {input_file}", {})
  call term_sendkeys(buf, ":HelpToc\<cr>")
  call WaitFor({-> term_getline(buf, 1) =~ 'press ? for help'})
  call VerifyScreenDump(buf, 'Test_helptoc_markdown_01', {})
  call term_sendkeys(buf, ":qa!\<cr>")
  call StopMNVInTerminal(buf)
endfunc