You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wikilinks-parser/lexer/lexer_test.go

51 lines
857 B
Go

2 years ago
package lexer
import (
"testing"
)
2 years ago
func Test_LexerSimple(t *testing.T) {
2 years ago
tt := []string{
2 years ago
"[[",
"]]",
"[[foo]]",
"[[foo]]",
"[[foo|bar]]",
2 years ago
}
for _, tc := range tt {
2 years ago
t.Run(tc, func(t *testing.T) {
t.Logf("checking %q", tc)
_, tokens := Lex(tc)
for tok := range tokens {
t.Logf("found token: %#v", tok)
}
})
}
}
/*
func Test_LexerFull(t *testing.T) {
tt := []string{
`[[Regular Link]]`,
`![[Transcluded Link]]`,
`[[Regular Link|Alias]]`,
`[[Regular Link#Subsection of page]]`,
`[[Regular Link^link to block]]`,
`[[Regular Link#Subsection of page|Alias]]`,
`[[Regular Link^link to block|Alias]]`,
`[[Regular Link\|Alias]]`,
`[[Regular Link^link to block\|Alias]]`,
`[[Regular Link#Subsection of page\|Alias]]`,
}
for _, tc := range tt {
2 years ago
t.Run(tc, func(t *testing.T) {
t.Fail()
})
}
}
2 years ago
*/