From: Ciro Santilli Date: Mon, 6 Oct 2014 10:02:52 +0000 (+0200) Subject: Merge pull request #133 from cirosantilli/better-bold-italic-test X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/1311140900e9505dfab3442dfce400f10fa351b6?hp=-c Merge pull request #133 from cirosantilli/better-bold-italic-test Improve bold and italic tests. --- 1311140900e9505dfab3442dfce400f10fa351b6 diff --combined test/syntax.vader index 4f0a175,8471695..ece36ee --- a/test/syntax.vader +++ b/test/syntax.vader @@@ -1,14 -1,18 +1,18 @@@ - Given mkd (bold); - **bold** not bold + Given mkd; + a **b** c - Execute (SyntaxOf(pattern)): + Execute (bold): + AssertNotEqual SyntaxOf('a'), 'htmlBold' AssertEqual SyntaxOf('b'), 'htmlBold' + AssertNotEqual SyntaxOf('c'), 'htmlBold' - Given mkd (italic); - *italic* + Given mkd; + a *b* c - Execute (SyntaxOf(pattern)): - AssertEqual SyntaxOf('i'), 'htmlItalic' + Execute (italic): + AssertNotEqual SyntaxOf('a'), 'htmlItalic' + AssertEqual SyntaxOf('b'), 'htmlItalic' + AssertNotEqual SyntaxOf('c'), 'htmlItalic' # Links @@@ -72,42 -76,3 +76,42 @@@ Execute (multiline math) AssertNotEqual SyntaxOf('a'), 'mkdMath' AssertEqual SyntaxOf('b'), 'mkdMath' AssertNotEqual SyntaxOf('c'), 'mkdMath' + +# YAML frontmatter + +Given mkd; +--- +a: b +--- + +Execute (YAML frontmatter is controlled by the option): + AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey' + let g:vim_markdown_frontmatter=1 + syn off | syn on + AssertEqual SyntaxOf('a'), 'yamlBlockMappingKey' + let g:vim_markdown_frontmatter=0 + syn off | syn on + AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey' + +Given mkd; + +--- +a: b +--- + +Execute (YAML frontmatter only works if it's the first thing in the file): + let g:vim_markdown_frontmatter=1 + syn off | syn on + AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey' + +Given mkd; +--- +a: b +--- + +--- + +Execute (rules are not mistaken by YAML frontmatter delimiters): + let g:vim_markdown_frontmatter=1 + syn off | syn on + AssertEqual SyntaxAt(5, 1), 'mkdRule'