]> git.madduck.net Git - etc/vim.git/blob - 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:

43f8085eceacd67a55e820b3aab2b34abd58c31a
[etc/vim.git] / 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), 0, '# Title'
25   AssertEqual foldlevel(3), 1, '## Chapter 1'
26   AssertEqual foldlevel(7), 1, '# This is just a comment'
27   AssertEqual foldlevel(8), 1, '```'
28   AssertEqual foldlevel(10), 1, '## Chapter 2'
29   AssertEqual foldlevel(12), 1, 'foobar'
30
31 Execute (fold text of chapters):
32   AssertEqual foldtextresult(3), '## Chapter 1 ' . repeat('-', winwidth(0) - 18) . ' 6'
33   AssertEqual foldtextresult(10), '## Chapter 2 ' . repeat('-', winwidth(0) - 18) . ' 2'
34
35 Given markdown;
36 Fold text 1
37 ==+ Fold Level 1
38 Fold text 2
39 --+ Fold Level 2
40
41 Execute (fold level ==+, --+):
42   AssertEqual foldlevel(2), 0, '==+'
43   AssertEqual foldlevel(4), 1, '--+'
44
45 Execute (fold text of ==+, --+):
46   AssertEqual foldtextresult(3), 'Fold text 2 ' . repeat('-', winwidth(0) - 17) . ' 1'
47
48 Given markdown;
49 Headline
50
51 foobar
52
53 # Title
54
55 Execute (fold any preamble):
56   AssertEqual foldlevel(1), 1, 'Headline'
57   AssertEqual foldlevel(3), 1, 'foobar'
58   AssertEqual foldlevel(5), 0, '# Title'