Skip to content

Commit

Permalink
added test for abs path
Browse files Browse the repository at this point in the history
  • Loading branch information
ekalinin committed Jul 26, 2015
1 parent 9a4a2b9 commit 952d493
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ func Test_is_url(t *testing.T) {
}

func Test_grab_toc_onerow(t *testing.T) {
t.Skip("not ready yet")
toc_expected := []string{
" * [README in another language](#readme-in-another-language)",
}
Expand All @@ -30,7 +29,6 @@ func Test_grab_toc_onerow(t *testing.T) {
}

func Test_grab_toc_onerow_with_newlines(t *testing.T) {
t.Skip("not ready yet")
toc_expected := []string{
" * [README in another language](#readme-in-another-language)",
}
Expand Down Expand Up @@ -117,3 +115,16 @@ func Test_GrabToc_backquoted(t *testing.T) {
}
}
}

func Test_grab_toc_with_abspath(t *testing.T) {
link := "https://github.com/ekalinin/envirius/blob/master/README.md"
toc_expected := []string{
" * [README in another language](" + link + "#readme-in-another-language)",
}
toc := GrabTocX(`
<h1><a id="user-content-readme-in-another-language" class="anchor" href="#readme-in-another-language" aria-hidden="true"><span class="octicon octicon-link"></span></a>README in another language</h1>
`, link)
if toc[0] != toc_expected[0] {
t.Error("Res :", toc, "\nExpected :", toc_expected)
}
}

0 comments on commit 952d493

Please sign in to comment.