expand escape character test cases

main v0.1.1
Nick Dumas 1 year ago
parent cb9786ece8
commit be33bd2c20

@ -11,7 +11,16 @@ import (
var wikilinkWithEscapeCharacters = []tc{ var wikilinkWithEscapeCharacters = []tc{
{ {
name: "wikilink", name: "wikilink with escaped close link",
in: `[[wiki\]\]link]]`,
expected: []markdown.Lexeme{
{Typ: markdown.LexOpenLink, Val: "[["},
{Typ: markdown.LexIdent, Val: `wiki\]\]link`},
{Typ: markdown.LexCloseLink, Val: "]]"},
},
},
{
name: "wikilink with partial escaped close link",
in: `[[wiki\]link]]`, in: `[[wiki\]link]]`,
expected: []markdown.Lexeme{ expected: []markdown.Lexeme{
{Typ: markdown.LexOpenLink, Val: "[["}, {Typ: markdown.LexOpenLink, Val: "[["},
@ -19,6 +28,42 @@ var wikilinkWithEscapeCharacters = []tc{
{Typ: markdown.LexCloseLink, Val: "]]"}, {Typ: markdown.LexCloseLink, Val: "]]"},
}, },
}, },
{
name: "wikilink with escaped alias",
in: `[[wiki\|link]]`,
expected: []markdown.Lexeme{
{Typ: markdown.LexOpenLink, Val: "[["},
{Typ: markdown.LexIdent, Val: `wiki\|link`},
{Typ: markdown.LexCloseLink, Val: "]]"},
},
},
{
name: "wikilink with escaped blockref",
in: `[[wiki\#\^link]]`,
expected: []markdown.Lexeme{
{Typ: markdown.LexOpenLink, Val: "[["},
{Typ: markdown.LexIdent, Val: `wiki\#\^link`},
{Typ: markdown.LexCloseLink, Val: "]]"},
},
},
{
name: "wikilink with partial escaped blockref",
in: `[[wiki\^link]]`,
expected: []markdown.Lexeme{
{Typ: markdown.LexOpenLink, Val: "[["},
{Typ: markdown.LexIdent, Val: `wiki\^link`},
{Typ: markdown.LexCloseLink, Val: "]]"},
},
},
{
name: "wikilink with escaped header",
in: `[[wiki\#link]]`,
expected: []markdown.Lexeme{
{Typ: markdown.LexOpenLink, Val: "[["},
{Typ: markdown.LexIdent, Val: `wiki\#link`},
{Typ: markdown.LexCloseLink, Val: "]]"},
},
},
} }
var singleWikilink = []tc{ var singleWikilink = []tc{

Loading…
Cancel
Save