From 3f4b66ce7266c2d7c3dfe1e84c9b801d8b11070f Mon Sep 17 00:00:00 2001 From: Pokey Rule <755842+pokey@users.noreply.github.com> Date: Thu, 14 Mar 2024 09:15:29 +0000 Subject: [PATCH] Add test cases --- .../changeEveryFirstThreeTokens.yml | 30 ++++++++++++++++++ .../changeEveryLastThreeTokens.yml | 30 ++++++++++++++++++ .../changeEveryNextThreeTokens.yml | 31 +++++++++++++++++++ .../changeEveryPreviousThreeTokens.yml | 31 +++++++++++++++++++ .../relativeScopes/changeEveryThreeTokens.yml | 31 +++++++++++++++++++ .../changeEveryThreeTokensBackward.yml | 31 +++++++++++++++++++ 6 files changed, 184 insertions(+) create mode 100644 packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/ordinalScopes/changeEveryFirstThreeTokens.yml create mode 100644 packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/ordinalScopes/changeEveryLastThreeTokens.yml create mode 100644 packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/relativeScopes/changeEveryNextThreeTokens.yml create mode 100644 packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/relativeScopes/changeEveryPreviousThreeTokens.yml create mode 100644 packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/relativeScopes/changeEveryThreeTokens.yml create mode 100644 packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/relativeScopes/changeEveryThreeTokensBackward.yml diff --git a/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/ordinalScopes/changeEveryFirstThreeTokens.yml b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/ordinalScopes/changeEveryFirstThreeTokens.yml new file mode 100644 index 0000000000..5bf1c3fb76 --- /dev/null +++ b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/ordinalScopes/changeEveryFirstThreeTokens.yml @@ -0,0 +1,30 @@ +languageId: plaintext +command: + version: 6 + spokenForm: change every first three tokens + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: ordinalScope + scopeType: {type: token} + start: 0 + length: 3 + isEvery: true + usePrePhraseSnapshot: true +initialState: + documentContents: aaa bbb ccc ddd + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + marks: {} +finalState: + documentContents: " ddd" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} diff --git a/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/ordinalScopes/changeEveryLastThreeTokens.yml b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/ordinalScopes/changeEveryLastThreeTokens.yml new file mode 100644 index 0000000000..0cbcecb0a5 --- /dev/null +++ b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/ordinalScopes/changeEveryLastThreeTokens.yml @@ -0,0 +1,30 @@ +languageId: plaintext +command: + version: 6 + spokenForm: change every last three tokens + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: ordinalScope + scopeType: {type: token} + start: -3 + length: 3 + isEvery: true + usePrePhraseSnapshot: true +initialState: + documentContents: aaa bbb ccc ddd + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + marks: {} +finalState: + documentContents: "aaa " + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} diff --git a/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/relativeScopes/changeEveryNextThreeTokens.yml b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/relativeScopes/changeEveryNextThreeTokens.yml new file mode 100644 index 0000000000..0c7b8e4673 --- /dev/null +++ b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/relativeScopes/changeEveryNextThreeTokens.yml @@ -0,0 +1,31 @@ +languageId: plaintext +command: + version: 6 + spokenForm: change every next three tokens + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: relativeScope + scopeType: {type: token} + offset: 1 + length: 3 + direction: forward + isEvery: true + usePrePhraseSnapshot: true +initialState: + documentContents: aaa bbb ccc ddd + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + marks: {} +finalState: + documentContents: "aaa " + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} diff --git a/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/relativeScopes/changeEveryPreviousThreeTokens.yml b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/relativeScopes/changeEveryPreviousThreeTokens.yml new file mode 100644 index 0000000000..902ea42729 --- /dev/null +++ b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/relativeScopes/changeEveryPreviousThreeTokens.yml @@ -0,0 +1,31 @@ +languageId: plaintext +command: + version: 6 + spokenForm: change every previous three tokens + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: relativeScope + scopeType: {type: token} + offset: 1 + length: 3 + direction: backward + isEvery: true + usePrePhraseSnapshot: true +initialState: + documentContents: aaa bbb ccc ddd + selections: + - anchor: {line: 0, character: 15} + active: {line: 0, character: 15} + marks: {} +finalState: + documentContents: " ddd" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} diff --git a/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/relativeScopes/changeEveryThreeTokens.yml b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/relativeScopes/changeEveryThreeTokens.yml new file mode 100644 index 0000000000..162f94b5a7 --- /dev/null +++ b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/relativeScopes/changeEveryThreeTokens.yml @@ -0,0 +1,31 @@ +languageId: plaintext +command: + version: 6 + spokenForm: change every three tokens + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: relativeScope + scopeType: {type: token} + offset: 0 + length: 3 + direction: forward + isEvery: true + usePrePhraseSnapshot: true +initialState: + documentContents: aaa bbb ccc ddd + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + marks: {} +finalState: + documentContents: " ddd" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} diff --git a/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/relativeScopes/changeEveryThreeTokensBackward.yml b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/relativeScopes/changeEveryThreeTokensBackward.yml new file mode 100644 index 0000000000..e14810748b --- /dev/null +++ b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/relativeScopes/changeEveryThreeTokensBackward.yml @@ -0,0 +1,31 @@ +languageId: plaintext +command: + version: 6 + spokenForm: change every three tokens backward + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: relativeScope + scopeType: {type: token} + offset: 0 + length: 3 + direction: backward + isEvery: true + usePrePhraseSnapshot: true +initialState: + documentContents: aaa bbb ccc ddd + selections: + - anchor: {line: 0, character: 15} + active: {line: 0, character: 15} + marks: {} +finalState: + documentContents: "aaa " + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6}