diff --git a/test/folding-toc.vader b/test/folding-toc.vader index 8d688f77..984ee756 100644 --- a/test/folding-toc.vader +++ b/test/folding-toc.vader @@ -121,28 +121,28 @@ Execute (check TOC): let res = getloclist(0) let elem = res[0] AssertEqual elem.lnum, 1 - AssertEqual elem.text, 'chap 1' + AssertEqual elem.text, '# chap 1' let elem = res[1] AssertEqual elem.lnum, 15 - AssertEqual elem.text, ' chap 1.1' + AssertEqual elem.text, '# chap 1.1' let elem = res[2] AssertEqual elem.lnum, 25 - AssertEqual elem.text, ' chap 1.1.1' + AssertEqual elem.text, '### chap 1.1.1' let elem = res[3] AssertEqual elem.lnum, 30 - AssertEqual elem.text, 'chap 2' + AssertEqual elem.text, '# chap 2' let elem = res[4] AssertEqual elem.lnum, 34 - AssertEqual elem.text, ' chap 2.1' + AssertEqual elem.text, '## chap 2.1' let elem = res[5] AssertEqual elem.lnum, 41 - AssertEqual elem.text, 'chap 3' + AssertEqual elem.text, '# chap 3' let elem = res[6] AssertEqual elem.lnum, 45 - AssertEqual elem.text, 'chap 4' + AssertEqual elem.text, '# chap 4' let elem = res[7] AssertEqual elem.lnum, 50 - AssertEqual elem.text, ' chap 4.1' + AssertEqual elem.text, '## chap 4.1' Given markdown; --- @@ -175,5 +175,5 @@ Execute (check Toc of yaml front matter): AssertEqual len(res), 1 let elem = res[0] AssertEqual elem.lnum, 8 - AssertEqual elem.text, ' heading' + AssertEqual elem.text, '## heading' unlet g:vim_markdown_frontmatter diff --git a/test/toc-autofit.vader b/test/toc-autofit.vader index 26789975..fd3d2de7 100644 --- a/test/toc-autofit.vader +++ b/test/toc-autofit.vader @@ -45,9 +45,9 @@ Execute (toc window autofit width): :Toc let real_width = winwidth(0) :lclose - let expected_width = len(line) + 2*5 + 1 + 3 - 7 + let expected_width = len(line) + 2*5 + 1 + 3 - 7 + 7 AssertEqual real_width, expected_width set nonumber " 2 spaces * 5 additional header levels + 1 space for first header + -" 3 spaces for line numbers - 7 chars ('###### ') that don't show up on the TOC +" 3 spaces for line numbers - 7 chars ('###### ') are removed, but added again. diff --git a/test/toc.vader b/test/toc.vader index 51269526..efb32b73 100644 --- a/test/toc.vader +++ b/test/toc.vader @@ -28,11 +28,14 @@ test Execute (Toc setex headers): :Toc + :setl modifiable + :%s/\m^\([^|]*|\)\{2} // + :setl nomodifiable nomodified Expect (setex headers): - header 1 - header 2 - header 3 + # header 1 + ## header 2 + ### header 3 Given markdown; # header 1 @@ -49,11 +52,14 @@ test Execute (Toc atx headers): :Toc + :setl modifiable + :%s/\m^\([^|]*|\)\{2} // + :setl nomodifiable nomodified Expect (atx headers): - header 1 - header 2 - header 3 + # header 1 + ## header 2 + ### header 3 Given markdown; ATX tests. @@ -135,34 +141,37 @@ setex h2 Execute (Toc multiple headers): :Toc + :setl modifiable + :%s/\m^\([^|]*|\)\{2} // + :setl nomodifiable nomodified Expect (multiple headers): - h1 space - h1 nospace - h1 2 spaces - h1 trailing hash - h2 space - h2 nospace - h2 trailing hash - h3 space - h3 nospace - h3 trailing hash - h4 - h5 - h6 - h1 before h2 - h2 between h1s - h1 after h2 - setex h1 - setex h2 - setex h1 single punctuation - setex h1 punctuation longer than header - setex h1 before atx - atx h2 - atx h3 - atx h1 - setex h2 - atx h3 2 + # h1 space + # h1 nospace + # h1 2 spaces + # h1 trailing hash + ## h2 space + ## h2 nospace + ## h2 trailing hash + ### h3 space + ### h3 nospace + ### h3 trailing hash + #### h4 + ##### h5 + ###### h6 + # h1 before h2 + ## h2 between h1s + # h1 after h2 + # setex h1 + ## setex h2 + # setex h1 single punctuation + # setex h1 punctuation longer than header + # setex h1 before atx + ## atx h2 + ### atx h3 + # atx h1 + ## setex h2 + ### atx h3 2 Execute: :lclose