mirror of
https://github.com/zyedidia/micro.git
synced 2024-10-27 12:37:38 +03:00
Improve buffer test
This commit is contained in:
parent
56f5b475eb
commit
b12886b066
@ -79,7 +79,6 @@ func check(t *testing.T, before []string, operations []operation, after []string
|
|||||||
cursor := cursors[i]
|
cursor := cursors[i]
|
||||||
b.SetCurCursor(cursor.Num)
|
b.SetCurCursor(cursor.Num)
|
||||||
cursor.DeleteSelection()
|
cursor.DeleteSelection()
|
||||||
cursor.ResetSelection()
|
|
||||||
b.Insert(cursor.Loc, strings.Join(op.text, "\n"))
|
b.Insert(cursor.Loc, strings.Join(op.text, "\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,7 +94,7 @@ func check(t *testing.T, before []string, operations []operation, after []string
|
|||||||
|
|
||||||
for i, op := range operations {
|
for i, op := range operations {
|
||||||
cursor := cursors[i]
|
cursor := cursors[i]
|
||||||
if !cursor.HasSelection() {
|
if op.start == op.end {
|
||||||
assert.Equal(op.start, cursor.Loc)
|
assert.Equal(op.start, cursor.Loc)
|
||||||
} else {
|
} else {
|
||||||
assert.Equal(op.start, cursor.CurSelection[0])
|
assert.Equal(op.start, cursor.CurSelection[0])
|
||||||
|
Loading…
Reference in New Issue
Block a user