Skip to content

Commit e33bf2d

Browse files
committed
Update file test doc to match current md2man format
and compare without worrying about leading/trailing space
1 parent 009899a commit e33bf2d

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

fish_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func expectFileContent(t *testing.T, file, expected string) {
7272
data, err := os.ReadFile(file)
7373
require.Nil(t, err)
7474

75-
require.Equal(t, strings.ReplaceAll(string(data), "\r\n", "\n"), expected)
75+
require.Equal(t, strings.TrimSpace(expected), strings.TrimSpace(strings.ReplaceAll(string(data), "\r\n", "\n")))
7676
}
7777

7878
func TestFishCompletion(t *testing.T) {

testdata/expected-doc-full.man

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
.SH Harrison
55

66
.SH NAME
7-
.PP
8-
greet - Some app
7+
greet \- Some app
98

109

1110
.SH SYNOPSIS
12-
.PP
1311
greet
1412

1513
.EX
@@ -20,7 +18,6 @@ greet
2018

2119

2220
.SH DESCRIPTION
23-
.PP
2421
app [first_arg] [second_arg]
2522

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

3330

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

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

4541
.SH COMMANDS
4642
.SH config, c
47-
.PP
4843
another usage test
4944

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

5651
.SS sub-config, s, ss
57-
.PP
5852
another usage test
5953

6054
.PP
@@ -64,7 +58,6 @@ another usage test
6458
\fB--sub-flag, --sub-fl, -s\fP="":
6559

6660
.SH info, i, in
67-
.PP
6861
retrieve generic information
6962

70-
.SH some-command
63+
.SH some-command

0 commit comments

Comments
 (0)