feat: #1140 updating test values to match with callback name

This commit is contained in:
Alexander Miranda 2024-06-19 12:55:06 -05:00
parent 0856a41798
commit b522459430
No known key found for this signature in database
GPG key ID: 22010069FB6DBA40

View file

@ -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 {
@ -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 {