|
|
@ -16,7 +16,6 @@ var testCases = []tc{
|
|
|
|
{Typ: wikilink.LexOpenLink, Val: "[["},
|
|
|
|
{Typ: wikilink.LexOpenLink, Val: "[["},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "wikilink"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "wikilink"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -28,7 +27,6 @@ var testCases = []tc{
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "display name"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "display name"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -42,7 +40,6 @@ var testCases = []tc{
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "second pipe"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "second pipe"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -56,7 +53,6 @@ var testCases = []tc{
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "second pipe"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "second pipe"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -66,7 +62,6 @@ var testCases = []tc{
|
|
|
|
{Typ: wikilink.LexOpenLink, Val: "[["},
|
|
|
|
{Typ: wikilink.LexOpenLink, Val: "[["},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "wikilink spaces"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "wikilink spaces"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -78,7 +73,6 @@ var testCases = []tc{
|
|
|
|
{Typ: wikilink.LexHeading, Val: "#"},
|
|
|
|
{Typ: wikilink.LexHeading, Val: "#"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "heading"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "heading"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -90,7 +84,6 @@ var testCases = []tc{
|
|
|
|
{Typ: wikilink.LexHeading, Val: "#"},
|
|
|
|
{Typ: wikilink.LexHeading, Val: "#"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "heading"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "heading"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -104,7 +97,6 @@ var testCases = []tc{
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "display name"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "display name"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -120,7 +112,6 @@ var testCases = []tc{
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "second pipe"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "second pipe"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -136,7 +127,6 @@ var testCases = []tc{
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "second pipe"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "second pipe"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -148,7 +138,6 @@ var testCases = []tc{
|
|
|
|
{Typ: wikilink.LexBlockRef, Val: "#^"},
|
|
|
|
{Typ: wikilink.LexBlockRef, Val: "#^"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "blockRef"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "blockRef"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -160,7 +149,6 @@ var testCases = []tc{
|
|
|
|
{Typ: wikilink.LexBlockRef, Val: "#^"},
|
|
|
|
{Typ: wikilink.LexBlockRef, Val: "#^"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "blockRef"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "blockRef"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -174,7 +162,6 @@ var testCases = []tc{
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "display name"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "display name"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -190,7 +177,6 @@ var testCases = []tc{
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "second pipe"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "second pipe"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -206,7 +192,6 @@ var testCases = []tc{
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexAlias, Val: "|"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "second pipe"},
|
|
|
|
{Typ: wikilink.LexIdent, Val: "second pipe"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexCloseLink, Val: "]]"},
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -255,7 +240,9 @@ func Test_ObsidianWikilinks_Basic(t *testing.T) {
|
|
|
|
[]wikilink.Lexeme{
|
|
|
|
[]wikilink.Lexeme{
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
nil,
|
|
|
|
[]wikilink.Lexeme{
|
|
|
|
|
|
|
|
{Typ: wikilink.LexText, Val: ""},
|
|
|
|
|
|
|
|
},
|
|
|
|
)
|
|
|
|
)
|
|
|
|
t.Run(mut.name, test)
|
|
|
|
t.Run(mut.name, test)
|
|
|
|
}
|
|
|
|
}
|
|
|
|