diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2025-10-02 19:52:38 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2025-10-02 19:52:38 +0200 |
| commit | 94dceb4f7c1740de9215b36ec183f93ca4337ee7 (patch) | |
| tree | 5ad184efb0b74dd3aa4da7585f88a3e3f6cb4ecc /markdown/lexer_test.go | |
| parent | 8b249c9ce8bd1c351daf80c6c9b095fb1bccafe2 (diff) | |
style(markdown): fix typo in package name
Diffstat (limited to 'markdown/lexer_test.go')
| -rw-r--r-- | markdown/lexer_test.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/markdown/lexer_test.go b/markdown/lexer_test.go new file mode 100644 index 0000000..c670753 --- /dev/null +++ b/markdown/lexer_test.go @@ -0,0 +1,30 @@ +package markdown + +import "testing" + +func TestLex(t *testing.T) { + lxs := lex("bonjour les gens") + if lxs.String() != "Lexers[literal(bonjour les gens) ]" { + t.Errorf("invalid lex, got %s", lxs) + } + lxs = lex("# bonjour les gens") + if lxs.String() != "Lexers[header(#) literal( bonjour les gens) ]" { + t.Errorf("invalid lex, got %s", lxs) + } + lxs = lex("# bonjour les gens\nComment ça va ?") + if lxs.String() != "Lexers[header(#) literal( bonjour les gens) break(\n) literal(Comment ça va ?) ]" { + t.Errorf("invalid lex, got %s", lxs) + } + lxs = lex("***hey***, what's up?") + if lxs.String() != "Lexers[modifier(***) literal(hey) modifier(***) literal(, what's up?) ]" { + t.Errorf("invalid lex, got %s", lxs) + } + lxs = lex(`Xxx\_DarkEmperor\_xxX`) + if lxs.String() != `Lexers[literal(Xxx_DarkEmperor_xxX) ]` { + t.Errorf("invalid lex, got %s", lxs) + } + lxs = lex(`* list`) + if lxs.String() != `Lexers[list(*) literal( list) ]` { + t.Errorf("invalid lex, got %s", lxs) + } +} |
