Skip to content

Commit

Permalink
Merge branch 'issue-4' (fix #4)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Feb 12, 2024
2 parents 1860239 + 08a24ef commit b6fe08d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
7 changes: 6 additions & 1 deletion parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ func parseStartuptime(file *os.File) (*measurement, error) {
l++
continue
}
e, err := parseStartuptimeEntity(s.Text(), l)
t := s.Text()
if t == "" {
// Neovim appends an extra empty line at the end of input (#4)
continue
}
e, err := parseStartuptimeEntity(t, l)
if err != nil {
return nil, err
}
Expand Down
16 changes: 0 additions & 16 deletions parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,22 +229,6 @@ func TestParseErrors(t *testing.T) {
lines: []string{""},
msg: "broken --startuptime output while parsing file",
},
{
what: "empty line",
lines: append(header, ""),
msg: "lack of fields: ''",
line: 7,
},
{
what: "empty line middle of lines",
lines: append(header,
"000.008 000.008: --- VIM STARTING ---",
"",
"000.190 000.182: Allocated generic buffers",
),
msg: "lack of fields: ''",
line: 8,
},
{
what: "invalid float at elapsed time",
lines: append(header, "00-.008 000.008: --- VIM STARTING ---"),
Expand Down

0 comments on commit b6fe08d

Please sign in to comment.