mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-02-02 06:43:23 +08:00
26 lines
353 B
Go
26 lines
353 B
Go
|
|
package diff
|
||
|
|
|
||
|
|
import (
|
||
|
|
"fmt"
|
||
|
|
"testing"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestParseConflictsAndCountLines(t *testing.T) {
|
||
|
|
conflictText := `<<<<<<< HEAD
|
||
|
|
old line 1
|
||
|
|
=======
|
||
|
|
new line 1
|
||
|
|
new line 2
|
||
|
|
>>>>>>> branch1
|
||
|
|
normal line
|
||
|
|
<<<<<<< HEAD
|
||
|
|
old line 2
|
||
|
|
old line 3
|
||
|
|
=======
|
||
|
|
new line 3
|
||
|
|
>>>>>>> branch2`
|
||
|
|
|
||
|
|
addedLines := ParseConflictsAndCountLines(conflictText)
|
||
|
|
fmt.Println(addedLines)
|
||
|
|
}
|