Skip to content

Commit

Permalink
create empty motion for testing with a non-matching f
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonatwork committed Jun 7, 2020
1 parent 3d4c7d9 commit e2a8eec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
4 changes: 0 additions & 4 deletions src/Motions/Match.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ export class MotionMatch extends Motion {
return obj;
}

static clearLast() {
MotionMatch.last = undefined;
}

static repeatLast(args: { isReverse?: boolean; n?: number }): Motion {
return MotionMatch.last ? MotionMatch.last.clone(args) : new MotionEmpty();
}
Expand Down
13 changes: 8 additions & 5 deletions test/ModeNormal/comma.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import * as BlackBox from '../Framework/BlackBox';
import { MotionMatch } from '../../src/Motions/Match';

suite('Normal: ,', () => {
MotionMatch.clearLast();

const testCases: BlackBox.TestCase[] = [
// Empty
// Empty - can only be tested in a fresh document
//{
// from: 'Foo aaa bbb ccc e[]nd\nBar end',
// inputs: ',',
// to: 'Foo aaa bbb ccc e[]nd\nBar end',
//},
// Empty - after no match
{
from: 'Foo aaa bbb ccc e[]nd\nBar end',
inputs: ',',
inputs: 'f X ,',
to: 'Foo aaa bbb ccc e[]nd\nBar end',
},
// f <char>
Expand Down
13 changes: 8 additions & 5 deletions test/ModeNormal/semicolon.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import * as BlackBox from '../Framework/BlackBox';
import { MotionMatch } from '../../src/Motions/Match';

suite('Normal: ;', () => {
MotionMatch.clearLast();

const testCases: BlackBox.TestCase[] = [
// Empty
// Empty - can only be tested in a fresh document
//{
// from: '[]Foo aaa bbb ccc end\nBar end',
// inputs: ';',
// to: '[]Foo aaa bbb ccc end\nBar end',
//},
// Empty - after no match
{
from: '[]Foo aaa bbb ccc end\nBar end',
inputs: ';',
inputs: 'f X ;',
to: '[]Foo aaa bbb ccc end\nBar end',
},
// f <char>
Expand Down

0 comments on commit e2a8eec

Please sign in to comment.