Skip to content

Commit

Permalink
added test for ekalinin#13
Browse files Browse the repository at this point in the history
  • Loading branch information
ekalinin committed Jul 15, 2015
1 parent 1056956 commit 4d56c99
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_backquote.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# The command `foo1`

Blabla...

## The command `foo2` is better

Blabla...

# The command `bar1`

Blabla...

## The command `bar2` is better

Blabla...

### The command `bar3` is the best

Blabla...
11 changes: 11 additions & 0 deletions tests/tests.bats
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,14 @@ load test_helper
assert_equal "${lines[4]}" " * [Básico](#básico)"
assert_equal "${lines[5]}" " * [Uso diário](#uso-diário)"
}

@test "TOC for text with backquote, #13" {
run $BATS_TEST_DIRNAME/../gh-md-toc tests/test_backquote.md
assert_success

assert_equal "${lines[2]}" " * [The command foo1 ](#the-command-foo1)"
assert_equal "${lines[3]}" " * [The command foo2 is better](#the-command-foo2-is-better)"
assert_equal "${lines[4]}" " * [The command bar1 ](#the-command-bar1)"
assert_equal "${lines[5]}" " * [The command bar2 is better](#the-command-bar2-is-better)"
assert_equal "${lines[6]}" " * [The command bar3 is the best](#the-command-bar3-is-the-best)"
}

0 comments on commit 4d56c99

Please sign in to comment.