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:
@ -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))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user