Skip to content

Commit 09b0b58

Browse files
committed
refactor(tests): Rename ZeroBasedPosition to NaturalEditorPosition
1 parent 273e7eb commit 09b0b58

File tree

12 files changed

+62
-62
lines changed

12 files changed

+62
-62
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Position } from 'vscode';
2+
3+
export class NaturalEditorPosition extends Position {
4+
constructor(editorDisplayedLine: number, editorDisplayedCharacter: number) {
5+
super(editorDisplayedLine - 1, editorDisplayedCharacter - 1);
6+
}
7+
}

src/test/integration/helpers/ZeroBasedPosition.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/test/integration/helpers/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { openDocument } from './openDocument';
2-
import { ZeroBasedPosition } from './ZeroBasedPosition';
2+
import { NaturalEditorPosition } from './NaturalEditorPosition';
33
import { zeroBasedLine } from './zeroBasedLine';
44
import { expectActiveTextEditorWithFile } from './expectActiveTextEditorWithFile';
55
import { documentLinesChanged } from './documentLinesChanged';
66
export {
77
openDocument,
8-
ZeroBasedPosition,
8+
NaturalEditorPosition,
99
zeroBasedLine,
1010
expectActiveTextEditorWithFile,
1111
documentLinesChanged,

src/test/integration/js/log-feature/class/classFunction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { expect } from 'chai';
44
import {
55
openDocument,
66
zeroBasedLine,
7-
ZeroBasedPosition,
7+
NaturalEditorPosition,
88
expectActiveTextEditorWithFile,
99
documentLinesChanged,
1010
} from '../../../helpers';
@@ -32,8 +32,8 @@ export default (): void => {
3232
if (activeTextEditor) {
3333
activeTextEditor.selections = [
3434
new vscode.Selection(
35-
new ZeroBasedPosition(2, 12),
36-
new ZeroBasedPosition(2, 20),
35+
new NaturalEditorPosition(2, 12),
36+
new NaturalEditorPosition(2, 20),
3737
),
3838
];
3939
await vscode.commands.executeCommand(

src/test/integration/js/log-feature/class/classNestedFunctions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Mocha, { it, describe } from 'mocha';
33
import { expect } from 'chai';
44
import {
55
openDocument,
6-
ZeroBasedPosition,
6+
NaturalEditorPosition,
77
zeroBasedLine,
88
expectActiveTextEditorWithFile,
99
documentLinesChanged,
@@ -35,8 +35,8 @@ export default (): void => {
3535
if (activeTextEditor) {
3636
activeTextEditor.selections = [
3737
new vscode.Selection(
38-
new ZeroBasedPosition(3, 30),
39-
new ZeroBasedPosition(3, 42),
38+
new NaturalEditorPosition(3, 30),
39+
new NaturalEditorPosition(3, 42),
4040
),
4141
];
4242
await vscode.commands.executeCommand(

src/test/integration/js/log-feature/function/anonymousFunctions.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { expect } from 'chai';
44
import {
55
openDocument,
66
zeroBasedLine,
7-
ZeroBasedPosition,
7+
NaturalEditorPosition,
88
expectActiveTextEditorWithFile,
99
documentLinesChanged,
1010
} from '../../../helpers';
@@ -36,8 +36,8 @@ export default (): void => {
3636
if (activeTextEditor) {
3737
activeTextEditor.selections = [
3838
new vscode.Selection(
39-
new ZeroBasedPosition(3, 29),
40-
new ZeroBasedPosition(3, 37),
39+
new NaturalEditorPosition(3, 29),
40+
new NaturalEditorPosition(3, 37),
4141
),
4242
];
4343
await vscode.commands.executeCommand(
@@ -74,8 +74,8 @@ export default (): void => {
7474
if (activeTextEditor) {
7575
activeTextEditor.selections = [
7676
new vscode.Selection(
77-
new ZeroBasedPosition(5, 14),
78-
new ZeroBasedPosition(5, 20),
77+
new NaturalEditorPosition(5, 14),
78+
new NaturalEditorPosition(5, 20),
7979
),
8080
];
8181
await vscode.commands.executeCommand(
@@ -117,8 +117,8 @@ export default (): void => {
117117
if (activeTextEditor) {
118118
activeTextEditor.selections = [
119119
new vscode.Selection(
120-
new ZeroBasedPosition(8, 14),
121-
new ZeroBasedPosition(8, 18),
120+
new NaturalEditorPosition(8, 14),
121+
new NaturalEditorPosition(8, 18),
122122
),
123123
];
124124
await vscode.commands.executeCommand(
@@ -163,8 +163,8 @@ export default (): void => {
163163
if (activeTextEditor) {
164164
activeTextEditor.selections = [
165165
new vscode.Selection(
166-
new ZeroBasedPosition(12, 16),
167-
new ZeroBasedPosition(12, 22),
166+
new NaturalEditorPosition(12, 16),
167+
new NaturalEditorPosition(12, 22),
168168
),
169169
];
170170
await vscode.commands.executeCommand(
@@ -206,8 +206,8 @@ export default (): void => {
206206
if (activeTextEditor) {
207207
activeTextEditor.selections = [
208208
new vscode.Selection(
209-
new ZeroBasedPosition(19, 16),
210-
new ZeroBasedPosition(19, 22),
209+
new NaturalEditorPosition(19, 16),
210+
new NaturalEditorPosition(19, 22),
211211
),
212212
];
213213
await vscode.commands.executeCommand(
@@ -249,8 +249,8 @@ export default (): void => {
249249
if (activeTextEditor) {
250250
activeTextEditor.selections = [
251251
new vscode.Selection(
252-
new ZeroBasedPosition(27, 18),
253-
new ZeroBasedPosition(27, 24),
252+
new NaturalEditorPosition(27, 18),
253+
new NaturalEditorPosition(27, 24),
254254
),
255255
];
256256
await vscode.commands.executeCommand(
@@ -292,8 +292,8 @@ export default (): void => {
292292
if (activeTextEditor) {
293293
activeTextEditor.selections = [
294294
new vscode.Selection(
295-
new ZeroBasedPosition(35, 18),
296-
new ZeroBasedPosition(35, 24),
295+
new NaturalEditorPosition(35, 18),
296+
new NaturalEditorPosition(35, 24),
297297
),
298298
];
299299
await vscode.commands.executeCommand(

src/test/integration/js/log-feature/function/emptyFunc.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Mocha, { describe, it } from 'mocha';
33
import { expect } from 'chai';
44
import {
55
openDocument,
6-
ZeroBasedPosition,
6+
NaturalEditorPosition,
77
zeroBasedLine,
88
expectActiveTextEditorWithFile,
99
documentLinesChanged,
@@ -31,8 +31,8 @@ export default (): void => {
3131
if (activeTextEditor) {
3232
activeTextEditor.selections = [
3333
new vscode.Selection(
34-
new ZeroBasedPosition(5, 15),
35-
new ZeroBasedPosition(5, 30),
34+
new NaturalEditorPosition(5, 15),
35+
new NaturalEditorPosition(5, 30),
3636
),
3737
];
3838
await vscode.commands.executeCommand(
@@ -62,8 +62,8 @@ export default (): void => {
6262
if (activeTextEditor) {
6363
activeTextEditor.selections = [
6464
new vscode.Selection(
65-
new ZeroBasedPosition(14, 19),
66-
new ZeroBasedPosition(14, 25),
65+
new NaturalEditorPosition(14, 19),
66+
new NaturalEditorPosition(14, 25),
6767
),
6868
];
6969
await vscode.commands.executeCommand(

src/test/integration/js/log-feature/function/functionAssignedToVariable.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { expect } from 'chai';
44
import {
55
openDocument,
66
zeroBasedLine,
7-
ZeroBasedPosition,
7+
NaturalEditorPosition,
88
expectActiveTextEditorWithFile,
99
documentLinesChanged,
1010
} from '../../../helpers';
@@ -35,8 +35,8 @@ export default (): void => {
3535
if (activeTextEditor) {
3636
const textDocument = activeTextEditor.document;
3737
activeTextEditor.selection = new vscode.Selection(
38-
new ZeroBasedPosition(3, 7),
39-
new ZeroBasedPosition(3, 20),
38+
new NaturalEditorPosition(3, 7),
39+
new NaturalEditorPosition(3, 20),
4040
);
4141
await vscode.commands.executeCommand(
4242
'turboConsoleLog.displayLogMessage',
@@ -64,8 +64,8 @@ export default (): void => {
6464
if (activeTextEditor) {
6565
const textDocument = activeTextEditor.document;
6666
activeTextEditor.selection = new vscode.Selection(
67-
new ZeroBasedPosition(7, 7),
68-
new ZeroBasedPosition(7, 24),
67+
new NaturalEditorPosition(7, 7),
68+
new NaturalEditorPosition(7, 24),
6969
);
7070
await vscode.commands.executeCommand(
7171
'turboConsoleLog.displayLogMessage',
@@ -93,8 +93,8 @@ export default (): void => {
9393
if (activeTextEditor) {
9494
const textDocument = activeTextEditor.document;
9595
activeTextEditor.selection = new vscode.Selection(
96-
new ZeroBasedPosition(11, 7),
97-
new ZeroBasedPosition(11, 34),
96+
new NaturalEditorPosition(11, 7),
97+
new NaturalEditorPosition(11, 34),
9898
);
9999
await vscode.commands.executeCommand(
100100
'turboConsoleLog.displayLogMessage',
@@ -122,8 +122,8 @@ export default (): void => {
122122
if (activeTextEditor) {
123123
const textDocument = activeTextEditor.document;
124124
activeTextEditor.selection = new vscode.Selection(
125-
new ZeroBasedPosition(18, 22),
126-
new ZeroBasedPosition(18, 27),
125+
new NaturalEditorPosition(18, 22),
126+
new NaturalEditorPosition(18, 27),
127127
);
128128
await vscode.commands.executeCommand(
129129
'turboConsoleLog.displayLogMessage',

src/test/integration/js/log-feature/function/functionWithDecorators.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Mocha, { it, describe } from 'mocha';
33
import { expect } from 'chai';
44
import {
55
openDocument,
6-
ZeroBasedPosition,
6+
NaturalEditorPosition,
77
zeroBasedLine,
88
expectActiveTextEditorWithFile,
99
documentLinesChanged,
@@ -35,8 +35,8 @@ export default (): void => {
3535
if (activeTextEditor) {
3636
activeTextEditor.selections = [
3737
new vscode.Selection(
38-
new ZeroBasedPosition(9, 20),
39-
new ZeroBasedPosition(9, 24),
38+
new NaturalEditorPosition(9, 20),
39+
new NaturalEditorPosition(9, 24),
4040
),
4141
];
4242
await vscode.commands.executeCommand(

src/test/integration/js/log-feature/function/promiseAnonymousFunction.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Mocha, { it, describe } from 'mocha';
33
import { expect } from 'chai';
44
import {
55
openDocument,
6-
ZeroBasedPosition,
6+
NaturalEditorPosition,
77
zeroBasedLine,
88
expectActiveTextEditorWithFile,
99
documentLinesChanged,
@@ -34,8 +34,8 @@ export default (): void => {
3434
if (activeTextEditor) {
3535
activeTextEditor.selections = [
3636
new vscode.Selection(
37-
new ZeroBasedPosition(6, 9),
38-
new ZeroBasedPosition(6, 21),
37+
new NaturalEditorPosition(6, 9),
38+
new NaturalEditorPosition(6, 21),
3939
),
4040
];
4141
await vscode.commands.executeCommand(
@@ -55,8 +55,8 @@ export default (): void => {
5555
).to.equal(true);
5656
activeTextEditor.selections = [
5757
new vscode.Selection(
58-
new ZeroBasedPosition(8, 9),
59-
new ZeroBasedPosition(8, 29),
58+
new NaturalEditorPosition(8, 9),
59+
new NaturalEditorPosition(8, 29),
6060
),
6161
];
6262
await vscode.commands.executeCommand(

0 commit comments

Comments
 (0)