Skip to content

Commit

Permalink
feat: #1140 updating test values to match with callback name
Browse files Browse the repository at this point in the history
  • Loading branch information
ammiranda committed Jun 19, 2024
1 parent 0856a41 commit b522459
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/md_docs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func TestGenMdTreeCustomWithFooter(t *testing.T) {
defer os.RemoveAll(tmpdir)

prepender := func(s string) string { return "Prepended" }
appender := func(s string) string { return "Postpended" }
appender := func(s string) string { return "Appended" }
identity := func(s string) string { return s }

if err := GenMarkdownTreeCustomWithFooter(rootCmd, tmpdir, prepender, appender, identity); err != nil {
Expand All @@ -143,17 +143,17 @@ func TestGenMdTreeCustomWithFooter(t *testing.T) {
gotRoot := fileContents(t, tmpdir, "root.md")
checkStringContains(t, gotRoot, "Prepended")
checkStringContains(t, gotRoot, rootCmd.Long)
checkStringContains(t, gotRoot, "Postpended")
checkStringContains(t, gotRoot, "Appended")

gotEcho := fileContents(t, tmpdir, "root_echo.md")
checkStringContains(t, gotEcho, "Prepended")
checkStringContains(t, gotEcho, echoCmd.Long)
checkStringContains(t, gotEcho, "Postpended")
checkStringContains(t, gotEcho, "Appended")

gotEchoSub := fileContents(t, tmpdir, "root_echo_echosub.md")
checkStringContains(t, gotEchoSub, "Prepended")
checkStringContains(t, gotEchoSub, echoSubCmd.Long)
checkStringContains(t, gotEchoSub, "Postpended")
checkStringContains(t, gotEchoSub, "Appended")
}

func fileContents(t *testing.T, dir, filename string) string {
Expand Down

0 comments on commit b522459

Please sign in to comment.