forked from limetext/commands
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselect_test.go
61 lines (54 loc) · 1.19 KB
/
select_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright 2013 The lime Authors.
// Use of this source code is governed by a 2-clause
// BSD-style license that can be found in the LICENSE file.
package commands
import (
"testing"
"github.com/limetext/text"
)
func TestSingleSelection(t *testing.T) {
tests := []findTest{
{
"Hello World!\nTest123123\nAbrakadabra\n",
[]text.Region{{1, 1}, {2, 2}, {3, 3}, {6, 6}},
[]text.Region{{1, 1}},
false,
},
{
"Hello World!\nTest123123\nAbrakadabra\n",
[]text.Region{{2, 2}, {3, 3}, {6, 6}},
[]text.Region{{2, 2}},
false,
},
{
"Hello World!\nTest123123\nAbrakadabra\n",
[]text.Region{{5, 5}},
[]text.Region{{5, 5}},
false,
},
}
runFindTest(tests, t, "single_selection")
}
func TestSelectAll(t *testing.T) {
tests := []findTest{
{
"Hello World!\nTest123123\nAbrakadabra\n",
[]text.Region{{1, 1}, {2, 2}, {3, 3}, {6, 6}},
[]text.Region{{0, 36}},
false,
},
{
"Hello World!\nTest123123\nAbrakadabra\n",
[]text.Region{{2, 2}, {3, 3}, {6, 6}},
[]text.Region{{0, 36}},
false,
},
{
"Hello World!\nTest123123\nAbrakadabra\n",
[]text.Region{{5, 5}},
[]text.Region{{0, 36}},
false,
},
}
runFindTest(tests, t, "select_all")
}