Skip to content

Commit 5b05a20

Browse files
authored
Add more e2e tests (#50)
1 parent 68775d0 commit 5b05a20

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
TODO.md
44
/gh-md-toc
55
build
6-
e2e-tests/got.md
6+
e2e-tests/got*.md
77
dist/

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ BUILD_DIR=build
44
BUILD_OS="windows darwin linux"
55
BUILD_ARCH="amd64"
66
E2E_DIR=e2e-tests
7+
E2E_RUN=go run cmd/gh-md-toc/main.go ./README.md
78

89
clean:
910
@rm -f ${EXEC}
@@ -25,8 +26,13 @@ test: clean lint
2526
@go test -cover -o ${EXEC}
2627

2728
e2e:
28-
go run cmd/gh-md-toc/main.go ./README.md > ${E2E_DIR}/got.md
29+
echo " >> Local MD & options ..."
30+
${E2E_RUN} > ${E2E_DIR}/got.md
2931
diff ${E2E_DIR}/want.md ${E2E_DIR}/got.md
32+
${E2E_RUN} --hide-header --hide-footer --depth=1 --no-escape > ${E2E_DIR}/got2.md
33+
diff ${E2E_DIR}/want2.md ${E2E_DIR}/got2.md
34+
${E2E_RUN} --hide-header --hide-footer --indent=4 > ${E2E_DIR}/got3.md
35+
diff ${E2E_DIR}/want3.md ${E2E_DIR}/got3.md
3036

3137
release: test
3238
@git tag v`grep "\tVersion" internals.go | grep -o -E '[0-9]\.[0-9]\.[0-9]{1,2}'`

e2e-tests/want2.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
* [github-markdown-toc](#github-markdown-toc)
2+
* [Table of Contents](#table-of-contents)
3+
* [Installation](#installation)
4+
* [Tests](#tests)
5+
* [Usage](#usage)
6+
* [Alpine Linux](#alpine-linux)
7+
* [LICENSE](#license)
8+

e2e-tests/want3.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
* [github\-markdown\-toc](#github-markdown-toc)
2+
* [Table of Contents](#table-of-contents)
3+
* [Installation](#installation)
4+
* [Precompiled binaries](#precompiled-binaries)
5+
* [Compiling from source](#compiling-from-source)
6+
* [Go Install](#go-install)
7+
* [Homebew (Mac only)](#homebew-mac-only)
8+
* [Tests](#tests)
9+
* [Usage](#usage)
10+
* [STDIN](#stdin)
11+
* [Local files](#local-files)
12+
* [Remote files](#remote-files)
13+
* [Multiple files](#multiple-files)
14+
* [Combo](#combo)
15+
* [Starting Depth](#starting-depth)
16+
* [Depth](#depth)
17+
* [No escape](#no-escape)
18+
* [GitHub token](#github-token)
19+
* [GitHub Enterprise Server](#github-enterprise-server)
20+
* [Bash/ZSH auto\-complete](#bashzsh-auto-complete)
21+
* [Alpine Linux](#alpine-linux)
22+
* [LICENSE](#license)
23+

0 commit comments

Comments
 (0)