aboutsummaryrefslogtreecommitdiff
path: root/markdown/lexer_test.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-10-02 19:52:38 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2025-10-02 19:52:38 +0200
commit94dceb4f7c1740de9215b36ec183f93ca4337ee7 (patch)
tree5ad184efb0b74dd3aa4da7585f88a3e3f6cb4ecc /markdown/lexer_test.go
parent8b249c9ce8bd1c351daf80c6c9b095fb1bccafe2 (diff)
style(markdown): fix typo in package name
Diffstat (limited to 'markdown/lexer_test.go')
-rw-r--r--markdown/lexer_test.go30
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)
+ }
+}