Skip to content

Commit 4d56c99

Browse files
committed
added test for #13
1 parent 1056956 commit 4d56c99

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

tests/test_backquote.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# The command `foo1`
2+
3+
Blabla...
4+
5+
## The command `foo2` is better
6+
7+
Blabla...
8+
9+
# The command `bar1`
10+
11+
Blabla...
12+
13+
## The command `bar2` is better
14+
15+
Blabla...
16+
17+
### The command `bar3` is the best
18+
19+
Blabla...

tests/tests.bats

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,14 @@ load test_helper
134134
assert_equal "${lines[4]}" " * [Básico](#básico)"
135135
assert_equal "${lines[5]}" " * [Uso diário](#uso-diário)"
136136
}
137+
138+
@test "TOC for text with backquote, #13" {
139+
run $BATS_TEST_DIRNAME/../gh-md-toc tests/test_backquote.md
140+
assert_success
141+
142+
assert_equal "${lines[2]}" " * [The command foo1 ](#the-command-foo1)"
143+
assert_equal "${lines[3]}" " * [The command foo2 is better](#the-command-foo2-is-better)"
144+
assert_equal "${lines[4]}" " * [The command bar1 ](#the-command-bar1)"
145+
assert_equal "${lines[5]}" " * [The command bar2 is better](#the-command-bar2-is-better)"
146+
assert_equal "${lines[6]}" " * [The command bar3 is the best](#the-command-bar3-is-the-best)"
147+
}

0 commit comments

Comments
 (0)