1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-07 22:02:56 +03:00

fix: fix stash with empty message

This commit is contained in:
Ryooooooga
2022-10-13 22:20:15 +09:00
parent fc0b14edef
commit a4239c7a37
4 changed files with 44 additions and 5 deletions

View File

@@ -36,6 +36,37 @@ func TestSplitLines(t *testing.T) {
}
}
func TestSplitNul(t *testing.T) {
type scenario struct {
multilineString string
expected []string
}
scenarios := []scenario{
{
"",
[]string{},
},
{
"\x00",
[]string{
"",
},
},
{
"hello world !\x00hello universe !\x00",
[]string{
"hello world !",
"hello universe !",
},
},
}
for _, s := range scenarios {
assert.EqualValues(t, s.expected, SplitNul(s.multilineString))
}
}
// TestNormalizeLinefeeds is a function.
func TestNormalizeLinefeeds(t *testing.T) {
type scenario struct {