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

improve merge conflict flow

This commit is contained in:
Jesse Duffield
2022-01-26 01:20:19 +11:00
parent ce3bcfe37c
commit c8cc18920f
17 changed files with 396 additions and 232 deletions

View File

@ -1,6 +1,7 @@
package mergeconflicts
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
@ -59,3 +60,42 @@ func TestDetermineLineType(t *testing.T) {
assert.EqualValues(t, s.expected, determineLineType(s.line))
}
}
func TestFindConflictsAux(t *testing.T) {
type scenario struct {
content string
expected bool
}
scenarios := []scenario{
{
content: "",
expected: false,
},
{
content: "blah",
expected: false,
},
{
content: ">>>>>>> ",
expected: true,
},
{
content: "<<<<<<< ",
expected: true,
},
{
content: " <<<<<<< ",
expected: false,
},
{
content: "a\nb\nc\n<<<<<<< ",
expected: true,
},
}
for _, s := range scenarios {
reader := strings.NewReader(s.content)
assert.EqualValues(t, s.expected, fileHasConflictMarkersAux(reader))
}
}