X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/1311140900e9505dfab3442dfce400f10fa351b6..3eb82a968fa932ab85d84544e958ecee22640468:/test/syntax.vader?ds=inline diff --git a/test/syntax.vader b/test/syntax.vader index ece36ee..bb9ef2f 100644 --- a/test/syntax.vader +++ b/test/syntax.vader @@ -1,4 +1,4 @@ -Given mkd; +Given markdown; a **b** c Execute (bold): @@ -6,7 +6,7 @@ Execute (bold): AssertEqual SyntaxOf('b'), 'htmlBold' AssertNotEqual SyntaxOf('c'), 'htmlBold' -Given mkd; +Given markdown; a *b* c Execute (italic): @@ -16,28 +16,98 @@ Execute (italic): # Links -Given mkd; +Given markdown; [a](b) Execute (link with title): AssertEqual SyntaxOf('a'), 'mkdLink' AssertEqual SyntaxOf('b'), 'mkdURL' -Given mkd; +Given markdown; (a) +(b) + Execute (parenthesis not in link): - AssertNotEqual SyntaxOf('a'), 'mkdLink' + AssertNotEqual SyntaxOf('a'), 'mkdURL' + AssertNotEqual SyntaxOf('b'), 'mkdURL' -Given mkd; +Given markdown; [a](b) c [d](e) Execute (multiple links on a line): AssertEqual SyntaxOf('c'), '' +# Autolinks + +Given markdown; +a c + +Execute (autolink): + AssertNotEqual SyntaxOf('a'), 'mkdInlineURL' + AssertEqual SyntaxOf('<'), 'mkdDelimiter' + AssertEqual SyntaxOf('b'), 'mkdInlineURL' + AssertEqual SyntaxOf('>'), 'mkdDelimiter' + AssertNotEqual SyntaxOf('c'), 'mkdInlineURL' + +Given markdown; + + +Execute (autolink with scheme case is insensitive): + AssertEqual SyntaxOf('a'), 'mkdInlineURL' + +Given markdown; + + +Execute (autolink without known scheme is not a link): + AssertNotEqual SyntaxOf('n'), 'mkdInlineURL' + +Given markdown; + + +Execute (autolink without scheme is not a link): + AssertNotEqual SyntaxOf('a'), 'mkdInlineURL' + +Given markdown; +< http://a > + + + +Execute (autolink with space is not a link): + AssertNotEqual SyntaxOf('a'), 'mkdInlineURL' + AssertNotEqual SyntaxOf('b'), 'mkdInlineURL' + AssertNotEqual SyntaxOf('c'), 'mkdInlineURL' + AssertNotEqual SyntaxOf('d'), 'mkdInlineURL' + AssertNotEqual SyntaxOf('e'), 'mkdInlineURL' + +Given markdown; +\ + +Execute (autolinks can be backslash escaped): + AssertNotEqual SyntaxOf('<'), 'mkdDelimiter' + +# Code Blocks + +Given markdown; +~~~ +code +~~~ + +Execute (code blocks can be fenced with tildes): + AssertEqual SyntaxOf('c'), 'mkdCode' + +Given markdown; +~~~ruby +code +~~~ + +Execute (code blocks can have a language specifier): + AssertEqual SyntaxOf('c'), 'mkdCode' + # Math -Given mkd; +Given markdown; a $x$ b c $$y$$ d \$e\$ @@ -61,7 +131,7 @@ Execute (math): AssertNotEqual SyntaxOf('x'), 'mkdMath' AssertNotEqual SyntaxOf('y'), 'mkdMath' -Given mkd; +Given markdown; a $ @@ -79,7 +149,7 @@ Execute (multiline math): # YAML frontmatter -Given mkd; +Given markdown; --- a: b --- @@ -93,7 +163,7 @@ Execute (YAML frontmatter is controlled by the option): syn off | syn on AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey' -Given mkd; +Given markdown; --- a: b @@ -104,7 +174,7 @@ Execute (YAML frontmatter only works if it's the first thing in the file): syn off | syn on AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey' -Given mkd; +Given markdown; --- a: b ---