From e33bf2d1d98604d8cfb555a384913921aa9d333f Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sat, 12 Oct 2024 20:15:02 -0400 Subject: [PATCH] Update file test doc to match current md2man format and compare without worrying about leading/trailing space --- fish_test.go | 2 +- testdata/expected-doc-full.man | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/fish_test.go b/fish_test.go index 0fe928656c..b2fdb6ee6a 100644 --- a/fish_test.go +++ b/fish_test.go @@ -72,7 +72,7 @@ func expectFileContent(t *testing.T, file, expected string) { data, err := os.ReadFile(file) require.Nil(t, err) - require.Equal(t, strings.ReplaceAll(string(data), "\r\n", "\n"), expected) + require.Equal(t, strings.TrimSpace(expected), strings.TrimSpace(strings.ReplaceAll(string(data), "\r\n", "\n"))) } func TestFishCompletion(t *testing.T) { diff --git a/testdata/expected-doc-full.man b/testdata/expected-doc-full.man index f6395fc1e6..ec91b70aa8 100644 --- a/testdata/expected-doc-full.man +++ b/testdata/expected-doc-full.man @@ -4,12 +4,10 @@ .SH Harrison .SH NAME -.PP -greet - Some app +greet \- Some app .SH SYNOPSIS -.PP greet .EX @@ -20,7 +18,6 @@ greet .SH DESCRIPTION -.PP app [first_arg] [second_arg] .PP @@ -32,7 +29,6 @@ greet [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...] .SH GLOBAL OPTIONS -.PP \fB--another-flag, -b\fP: another usage text .PP @@ -44,7 +40,6 @@ greet [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...] .SH COMMANDS .SH config, c -.PP another usage test .PP @@ -54,7 +49,6 @@ another usage test \fB--flag, --fl, -f\fP="": .SS sub-config, s, ss -.PP another usage test .PP @@ -64,7 +58,6 @@ another usage test \fB--sub-flag, --sub-fl, -s\fP="": .SH info, i, in -.PP retrieve generic information -.SH some-command \ No newline at end of file +.SH some-command