Skip to content

Commit 21b9726

Browse files
committed
Add a bunch of tests
1 parent e3554ec commit 21b9726

14 files changed

+352
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
languageId: plaintext
2+
command:
3+
spokenForm: clear next two token
4+
version: 3
5+
targets:
6+
- type: primitive
7+
modifiers:
8+
- type: relativeScope
9+
scopeType: {type: token}
10+
offset: 1
11+
length: 2
12+
direction: forward
13+
usePrePhraseSnapshot: true
14+
action: {name: clearAndSetSelection}
15+
initialState:
16+
documentContents: aaa bbb ccc ddd
17+
selections:
18+
- anchor: {line: 0, character: 6}
19+
active: {line: 0, character: 6}
20+
marks: {}
21+
finalState:
22+
documentContents: "aaa bbb "
23+
selections:
24+
- anchor: {line: 0, character: 8}
25+
active: {line: 0, character: 8}
26+
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: relativeScope, scopeType: {type: token}, offset: 1, length: 2, direction: forward}]}]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
languageId: plaintext
2+
command:
3+
spokenForm: clear next two token
4+
version: 3
5+
targets:
6+
- type: primitive
7+
modifiers:
8+
- type: relativeScope
9+
scopeType: {type: token}
10+
offset: 1
11+
length: 2
12+
direction: forward
13+
usePrePhraseSnapshot: true
14+
action: {name: clearAndSetSelection}
15+
initialState:
16+
documentContents: aaa bbb ccc
17+
selections:
18+
- anchor: {line: 0, character: 4}
19+
active: {line: 0, character: 4}
20+
marks: {}
21+
finalState:
22+
documentContents: "aaa "
23+
selections:
24+
- anchor: {line: 0, character: 5}
25+
active: {line: 0, character: 5}
26+
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: relativeScope, scopeType: {type: token}, offset: 1, length: 2, direction: forward}]}]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
languageId: plaintext
2+
command:
3+
spokenForm: clear one token
4+
version: 3
5+
targets:
6+
- type: primitive
7+
modifiers:
8+
- type: relativeScope
9+
scopeType: {type: token}
10+
offset: 0
11+
length: 1
12+
direction: forward
13+
usePrePhraseSnapshot: true
14+
action: {name: clearAndSetSelection}
15+
initialState:
16+
documentContents: aaa bbb ccc ddd eee fff
17+
selections:
18+
- anchor: {line: 0, character: 9}
19+
active: {line: 0, character: 13}
20+
marks: {}
21+
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: relativeScope, scopeType: {type: token}, offset: 0, length: 1, direction: forward}]}]
22+
thrownError: {name: TooFewScopesError}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
languageId: plaintext
2+
command:
3+
spokenForm: clear previous two token
4+
version: 3
5+
targets:
6+
- type: primitive
7+
modifiers:
8+
- type: relativeScope
9+
scopeType: {type: token}
10+
offset: 1
11+
length: 2
12+
direction: backward
13+
usePrePhraseSnapshot: true
14+
action: {name: clearAndSetSelection}
15+
initialState:
16+
documentContents: aaa bbb ccc
17+
selections:
18+
- anchor: {line: 0, character: 8}
19+
active: {line: 0, character: 8}
20+
marks: {}
21+
finalState:
22+
documentContents: " ccc"
23+
selections:
24+
- anchor: {line: 0, character: 0}
25+
active: {line: 0, character: 0}
26+
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: relativeScope, scopeType: {type: token}, offset: 1, length: 2, direction: backward}]}]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
languageId: plaintext
2+
command:
3+
spokenForm: clear previous two token
4+
version: 3
5+
targets:
6+
- type: primitive
7+
modifiers:
8+
- type: relativeScope
9+
scopeType: {type: token}
10+
offset: 1
11+
length: 2
12+
direction: backward
13+
usePrePhraseSnapshot: true
14+
action: {name: clearAndSetSelection}
15+
initialState:
16+
documentContents: aaa bbb ccc
17+
selections:
18+
- anchor: {line: 0, character: 10}
19+
active: {line: 0, character: 10}
20+
marks: {}
21+
finalState:
22+
documentContents: " ccc"
23+
selections:
24+
- anchor: {line: 0, character: 0}
25+
active: {line: 0, character: 0}
26+
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: relativeScope, scopeType: {type: token}, offset: 1, length: 2, direction: backward}]}]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
languageId: plaintext
2+
command:
3+
spokenForm: clear previous two token
4+
version: 3
5+
targets:
6+
- type: primitive
7+
modifiers:
8+
- type: relativeScope
9+
scopeType: {type: token}
10+
offset: 1
11+
length: 2
12+
direction: backward
13+
usePrePhraseSnapshot: true
14+
action: {name: clearAndSetSelection}
15+
initialState:
16+
documentContents: aaa bbb ccc
17+
selections:
18+
- anchor: {line: 0, character: 6}
19+
active: {line: 0, character: 6}
20+
marks: {}
21+
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: relativeScope, scopeType: {type: token}, offset: 1, length: 2, direction: backward}]}]
22+
thrownError: {name: OutOfRangeError}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
languageId: plaintext
2+
command:
3+
spokenForm: clear three token
4+
version: 3
5+
targets:
6+
- type: primitive
7+
modifiers:
8+
- type: relativeScope
9+
scopeType: {type: token}
10+
offset: 0
11+
length: 3
12+
direction: forward
13+
usePrePhraseSnapshot: true
14+
action: {name: clearAndSetSelection}
15+
initialState:
16+
documentContents: aaa bbb ccc ddd eee fff
17+
selections:
18+
- anchor: {line: 0, character: 9}
19+
active: {line: 0, character: 13}
20+
marks: {}
21+
finalState:
22+
documentContents: aaa bbb fff
23+
selections:
24+
- anchor: {line: 0, character: 8}
25+
active: {line: 0, character: 8}
26+
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: relativeScope, scopeType: {type: token}, offset: 0, length: 3, direction: forward}]}]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
languageId: plaintext
2+
command:
3+
spokenForm: clear three token backward
4+
version: 3
5+
targets:
6+
- type: primitive
7+
modifiers:
8+
- type: relativeScope
9+
scopeType: {type: token}
10+
offset: 0
11+
length: 3
12+
direction: backward
13+
usePrePhraseSnapshot: true
14+
action: {name: clearAndSetSelection}
15+
initialState:
16+
documentContents: aaa bbb ccc ddd eee fff
17+
selections:
18+
- anchor: {line: 0, character: 9}
19+
active: {line: 0, character: 13}
20+
marks: {}
21+
finalState:
22+
documentContents: aaa eee fff
23+
selections:
24+
- anchor: {line: 0, character: 4}
25+
active: {line: 0, character: 4}
26+
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: relativeScope, scopeType: {type: token}, offset: 0, length: 3, direction: backward}]}]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
languageId: plaintext
2+
command:
3+
spokenForm: clear two token
4+
version: 3
5+
targets:
6+
- type: primitive
7+
modifiers:
8+
- type: relativeScope
9+
scopeType: {type: token}
10+
offset: 0
11+
length: 2
12+
direction: forward
13+
usePrePhraseSnapshot: true
14+
action: {name: clearAndSetSelection}
15+
initialState:
16+
documentContents: aaa bbb ccc ddd eee fff
17+
selections:
18+
- anchor: {line: 0, character: 9}
19+
active: {line: 0, character: 13}
20+
marks: {}
21+
finalState:
22+
documentContents: aaa bbb eee fff
23+
selections:
24+
- anchor: {line: 0, character: 8}
25+
active: {line: 0, character: 8}
26+
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: relativeScope, scopeType: {type: token}, offset: 0, length: 2, direction: forward}]}]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
languageId: plaintext
2+
command:
3+
spokenForm: clear two token
4+
version: 3
5+
targets:
6+
- type: primitive
7+
modifiers:
8+
- type: relativeScope
9+
scopeType: {type: token}
10+
offset: 0
11+
length: 2
12+
direction: forward
13+
usePrePhraseSnapshot: true
14+
action: {name: clearAndSetSelection}
15+
initialState:
16+
documentContents: aaa bbb ccc
17+
selections:
18+
- anchor: {line: 0, character: 5}
19+
active: {line: 0, character: 5}
20+
marks: {}
21+
finalState:
22+
documentContents: "aaa "
23+
selections:
24+
- anchor: {line: 0, character: 4}
25+
active: {line: 0, character: 4}
26+
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: relativeScope, scopeType: {type: token}, offset: 0, length: 2, direction: forward}]}]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
languageId: plaintext
2+
command:
3+
spokenForm: clear two token
4+
version: 3
5+
targets:
6+
- type: primitive
7+
modifiers:
8+
- type: relativeScope
9+
scopeType: {type: token}
10+
offset: 0
11+
length: 2
12+
direction: forward
13+
usePrePhraseSnapshot: true
14+
action: {name: clearAndSetSelection}
15+
initialState:
16+
documentContents: aaa bbb ccc
17+
selections:
18+
- anchor: {line: 0, character: 4}
19+
active: {line: 0, character: 4}
20+
marks: {}
21+
finalState:
22+
documentContents: "aaa "
23+
selections:
24+
- anchor: {line: 0, character: 5}
25+
active: {line: 0, character: 5}
26+
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: relativeScope, scopeType: {type: token}, offset: 0, length: 2, direction: forward}]}]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
languageId: plaintext
2+
command:
3+
spokenForm: clear two token
4+
version: 3
5+
targets:
6+
- type: primitive
7+
modifiers:
8+
- type: relativeScope
9+
scopeType: {type: token}
10+
offset: 0
11+
length: 2
12+
direction: forward
13+
usePrePhraseSnapshot: true
14+
action: {name: clearAndSetSelection}
15+
initialState:
16+
documentContents: aaa bbb ccc
17+
selections:
18+
- anchor: {line: 0, character: 9}
19+
active: {line: 0, character: 9}
20+
marks: {}
21+
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: relativeScope, scopeType: {type: token}, offset: 0, length: 2, direction: forward}]}]
22+
thrownError: {name: OutOfRangeError}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
languageId: plaintext
2+
command:
3+
spokenForm: clear two token backward
4+
version: 3
5+
targets:
6+
- type: primitive
7+
modifiers:
8+
- type: relativeScope
9+
scopeType: {type: token}
10+
offset: 0
11+
length: 2
12+
direction: backward
13+
usePrePhraseSnapshot: true
14+
action: {name: clearAndSetSelection}
15+
initialState:
16+
documentContents: aaa bbb ccc
17+
selections:
18+
- anchor: {line: 0, character: 5}
19+
active: {line: 0, character: 5}
20+
marks: {}
21+
finalState:
22+
documentContents: " ccc"
23+
selections:
24+
- anchor: {line: 0, character: 0}
25+
active: {line: 0, character: 0}
26+
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: relativeScope, scopeType: {type: token}, offset: 0, length: 2, direction: backward}]}]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
languageId: plaintext
2+
command:
3+
spokenForm: clear two token backward
4+
version: 3
5+
targets:
6+
- type: primitive
7+
modifiers:
8+
- type: relativeScope
9+
scopeType: {type: token}
10+
offset: 0
11+
length: 2
12+
direction: backward
13+
usePrePhraseSnapshot: true
14+
action: {name: clearAndSetSelection}
15+
initialState:
16+
documentContents: aaa bbb ccc
17+
selections:
18+
- anchor: {line: 0, character: 8}
19+
active: {line: 0, character: 8}
20+
marks: {}
21+
finalState:
22+
documentContents: " ccc"
23+
selections:
24+
- anchor: {line: 0, character: 0}
25+
active: {line: 0, character: 0}
26+
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: relativeScope, scopeType: {type: token}, offset: 0, length: 2, direction: backward}]}]

0 commit comments

Comments
 (0)