]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/vim-markdown/test/python-folding.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Add '.vim/bundle/vim-flake8/' from commit 'ddceec6c457fd59bc2a9321cbf817e42aa4bfd86'
[etc/vim.git] / .vim / bundle / vim-markdown / test / python-folding.vader
1 Before:
2   let g:vim_markdown_folding_style_pythonic = 1
3   source ../after/ftplugin/markdown.vim
4
5 After:
6   setlocal foldexpr=0
7   setlocal foldmethod=manual
8
9 Given markdown;
10 # Title
11
12 ## Chapter 1
13
14 ```
15 This is code block
16 # This is just a comment
17 ```
18
19 ## Chapter 2
20
21 foobar
22
23 Execute (fold level # in code block):
24   AssertEqual foldlevel(1), 1, '# Title'
25   AssertEqual foldlevel(3), 2, '## Chapter 1'
26   AssertEqual foldlevel(7), 2, '# This is just a comment'
27   AssertEqual foldlevel(8), 2, '```'
28   AssertEqual foldlevel(10), 2, '## Chapter 2'
29   AssertEqual foldlevel(12), 2, 'foobar'
30
31 Execute (fold text of chapters):
32   let b:width = winwidth(0)
33   let b:hyphen = repeat('-', b:width - 18 > 2 ? b:width - 18 : b:width - 9 > 0 ? 3 : 2)
34   AssertEqual foldtextresult(10), strpart('## Chapter 2', 0, b:width - 9) . ' ' . b:hyphen . ' 2'
35
36 Given markdown;
37 Fold text 1
38 ===========
39 Fold text 2
40 -----------
41
42 Execute (fold level ==, --):
43   AssertEqual foldlevel(2), 0, '=='
44   AssertEqual foldlevel(4), 1, '--'
45
46 Execute (fold text of ==, --):
47   let b:width = winwidth(0)
48   let b:hyphen = repeat('-', b:width - 17 > 2 ? b:width - 17 : b:width - 9 > 0 ? 3 : 2)
49   AssertEqual foldtextresult(3), strpart('Fold text 2', 0, b:width - 9) . ' ' . b:hyphen . ' 1'
50
51 Given markdown;
52 Headline
53
54 foobar
55
56 # Title
57
58 Execute (fold any preamble):
59   AssertEqual foldlevel(1), 1, 'Headline'
60   AssertEqual foldlevel(3), 1, 'foobar'
61   AssertEqual foldlevel(5), 1, '# Title'
62
63 Given markdown;
64 ---
65 layout: article
66 title: A test of the heading folding when there is YAML frontmatter
67 tags: markdown yaml vim-markdown
68 ---
69 body
70
71 heading
72 -------
73
74 Execute (fold level of yaml front matter):
75   let g:vim_markdown_frontmatter = 1
76   source ../after/ftplugin/markdown.vim
77   AssertEqual foldlevel(1), 1, '---'
78   AssertEqual foldlevel(2), 1, 'layout: article'
79   AssertEqual foldlevel(4), 1, 'tags: markdown yaml vim-markdown'
80   AssertEqual foldlevel(5), 1, '---'
81   AssertEqual foldlevel(6), 1, 'body'
82   AssertEqual foldlevel(8), 1, 'heading'
83   AssertEqual foldlevel(9), 1, '-------'
84   unlet g:vim_markdown_frontmatter