Skip to content

Commit

Permalink
Update file test doc to match current md2man format
Browse files Browse the repository at this point in the history
and compare without worrying about leading/trailing space
  • Loading branch information
meatballhat committed Oct 13, 2024
1 parent 009899a commit e33bf2d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion fish_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
11 changes: 2 additions & 9 deletions testdata/expected-doc-full.man
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
.SH Harrison

.SH NAME
.PP
greet - Some app
greet \- Some app


.SH SYNOPSIS
.PP
greet

.EX
Expand All @@ -20,7 +18,6 @@ greet


.SH DESCRIPTION
.PP
app [first_arg] [second_arg]

.PP
Expand All @@ -32,7 +29,6 @@ greet [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...]


.SH GLOBAL OPTIONS
.PP
\fB--another-flag, -b\fP: another usage text

.PP
Expand All @@ -44,7 +40,6 @@ greet [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...]

.SH COMMANDS
.SH config, c
.PP
another usage test

.PP
Expand All @@ -54,7 +49,6 @@ another usage test
\fB--flag, --fl, -f\fP="":

.SS sub-config, s, ss
.PP
another usage test

.PP
Expand All @@ -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
.SH some-command

0 comments on commit e33bf2d

Please sign in to comment.