mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
Fix ForEachLineInFile to not lose the last line if it doesn't end with a LF
This commit is contained in:
@ -26,10 +26,7 @@ func Test_forEachLineInStream(t *testing.T) {
|
||||
{
|
||||
name: "single line without line feed",
|
||||
input: "abc",
|
||||
/* EXPECTED:
|
||||
expectedLines: []string{"abc"},
|
||||
ACTUAL: */
|
||||
expectedLines: []string{},
|
||||
},
|
||||
{
|
||||
name: "multiple lines",
|
||||
@ -44,10 +41,7 @@ func Test_forEachLineInStream(t *testing.T) {
|
||||
{
|
||||
name: "multiple lines without linefeed at end of file",
|
||||
input: "abc\ndef\nghi",
|
||||
/* EXPECTED:
|
||||
expectedLines: []string{"abc\n", "def\n", "ghi"},
|
||||
ACTUAL: */
|
||||
expectedLines: []string{"abc\n", "def\n"},
|
||||
},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user