Skip to content

Commit

Permalink
Added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasArvidsson committed Feb 18, 2024
1 parent 96be54c commit 71303d6
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class CommandRunnerImpl implements CommandRunner {
private pipelineRunner: TargetPipelineRunner,
private actions: ActionRecord,
) {
this.runAction = this.runAction.bind(this);
this.inferenceContext = new InferenceContext(this.debug);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
languageId: plaintext
command:
version: 7
spokenForm: bring fine
action:
name: replaceWithTarget
source:
type: primitive
mark: {type: decoratedSymbol, symbolColor: default, character: f}
destination: {type: implicit}
usePrePhraseSnapshot: true
initialState:
documentContents: foo
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 3}
marks:
default.f:
start: {line: 0, character: 0}
end: {line: 0, character: 3}
finalState:
documentContents: foo
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 3}
fallback:
action: insert
modifiers: []
text: foo
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
languageId: plaintext
command:
version: 7
spokenForm: move fine
action:
name: moveToTarget
source:
type: primitive
mark: {type: decoratedSymbol, symbolColor: default, character: f}
destination: {type: implicit}
usePrePhraseSnapshot: true
initialState:
documentContents: foo
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
marks:
default.f:
start: {line: 0, character: 0}
end: {line: 0, character: 3}
finalState:
documentContents: ""
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
fallback:
action: insert
modifiers: []
text: foo
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
languageId: plaintext
command:
version: 7
spokenForm: take this
action:
name: setSelection
target:
type: primitive
mark: {type: cursor}
usePrePhraseSnapshot: true
initialState:
documentContents: foo
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
marks: {}
finalState:
documentContents: foo
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
fallback:
action: setSelection
modifiers:
- {type: containingTokenIfEmpty}
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ command:
initialState:
documentContents: foo
selections:
- anchor: {line: 0, character: 3}
active: {line: 0, character: 3}
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
marks: {}
finalState:
documentContents: foo
selections:
- anchor: {line: 0, character: 3}
active: {line: 0, character: 3}
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
fallback:
action: setSelection
modifiers:
Expand Down

0 comments on commit 71303d6

Please sign in to comment.