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

4f0a17551168f8d1dedf0fd3fd2176ff942cf6c8
[etc/vim.git] / test / syntax.vader
1 Given mkd (bold);
2 **bold** not bold
3
4 Execute (SyntaxOf(pattern)):
5   AssertEqual SyntaxOf('b'), 'htmlBold'
6
7 Given mkd (italic);
8 *italic*
9
10 Execute (SyntaxOf(pattern)):
11   AssertEqual SyntaxOf('i'), 'htmlItalic'
12
13 # Links
14
15 Given mkd;
16 [a](b)
17
18 Execute (link with title):
19   AssertEqual SyntaxOf('a'), 'mkdLink'
20   AssertEqual SyntaxOf('b'), 'mkdURL'
21
22 Given mkd;
23 (a)
24
25 Execute (parenthesis not in link):
26   AssertNotEqual SyntaxOf('a'), 'mkdLink'
27
28 Given mkd;
29 [a](b) c [d](e)
30
31 Execute (multiple links on a line):
32   AssertEqual SyntaxOf('c'), ''
33
34 # Math
35
36 Given mkd;
37 a $x$ b
38 c $$y$$ d
39 \$e\$
40 \$\$f\$\$
41
42 Execute (math):
43   AssertNotEqual SyntaxOf('x'), 'mkdMath'
44   AssertNotEqual SyntaxOf('y'), 'mkdMath'
45   let g:vim_markdown_math=1
46   syn off | syn on
47   AssertNotEqual SyntaxOf('a'), 'mkdMath'
48   AssertNotEqual SyntaxOf('b'), 'mkdMath'
49   AssertNotEqual SyntaxOf('c'), 'mkdMath'
50   AssertNotEqual SyntaxOf('d'), 'mkdMath'
51   AssertNotEqual SyntaxOf('e'), 'mkdMath'
52   AssertNotEqual SyntaxOf('f'), 'mkdMath'
53   AssertEqual SyntaxOf('x'), 'mkdMath'
54   AssertEqual SyntaxOf('y'), 'mkdMath'
55   let g:vim_markdown_math=0
56   syn off | syn on
57   AssertNotEqual SyntaxOf('x'), 'mkdMath'
58   AssertNotEqual SyntaxOf('y'), 'mkdMath'
59
60 Given mkd;
61 a
62
63 $
64 b
65 $
66
67 c
68
69 Execute (multiline math):
70   let g:vim_markdown_math=1
71   syn off | syn on
72   AssertNotEqual SyntaxOf('a'), 'mkdMath'
73   AssertEqual SyntaxOf('b'), 'mkdMath'
74   AssertNotEqual SyntaxOf('c'), 'mkdMath'
75
76 # YAML frontmatter
77
78 Given mkd;
79 ---
80 a: b
81 ---
82
83 Execute (YAML frontmatter is controlled by the option):
84   AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
85   let g:vim_markdown_frontmatter=1
86   syn off | syn on
87   AssertEqual SyntaxOf('a'), 'yamlBlockMappingKey'
88   let g:vim_markdown_frontmatter=0
89   syn off | syn on
90   AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
91
92 Given mkd;
93
94 ---
95 a: b
96 ---
97
98 Execute (YAML frontmatter only works if it's the first thing in the file):
99   let g:vim_markdown_frontmatter=1
100   syn off | syn on
101   AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
102
103 Given mkd;
104 ---
105 a: b
106 ---
107
108 ---
109
110 Execute (rules are not mistaken by YAML frontmatter delimiters):
111   let g:vim_markdown_frontmatter=1
112   syn off | syn on
113   AssertEqual SyntaxAt(5, 1), 'mkdRule'