From d392d547adfedbd446cc5d749183984d3035365e Mon Sep 17 00:00:00 2001 From: Kou Tenichi Date: Thu, 6 Apr 2017 18:11:10 +0900 Subject: [PATCH] Added tests. --- test/ModeNormal/~.test.ts | 2 +- test/ModeVisual/h.test.ts | 30 ++++++++++++++++++++++++++++++ test/ModeVisual/l.test.ts | 30 ++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 test/ModeVisual/h.test.ts create mode 100644 test/ModeVisual/l.test.ts diff --git a/test/ModeNormal/~.test.ts b/test/ModeNormal/~.test.ts index 048f3c77..14461380 100644 --- a/test/ModeNormal/~.test.ts +++ b/test/ModeNormal/~.test.ts @@ -1,6 +1,6 @@ import * as BlackBox from '../Framework/BlackBox'; -suite.only('Normal: ~', () => { +suite('Normal: ~', () => { const testCases: BlackBox.TestCase[] = [ { from: '[]Foo', diff --git a/test/ModeVisual/h.test.ts b/test/ModeVisual/h.test.ts new file mode 100644 index 00000000..ff8cc279 --- /dev/null +++ b/test/ModeVisual/h.test.ts @@ -0,0 +1,30 @@ +import * as BlackBox from '../Framework/BlackBox'; + +suite('Visual: h', () => { + const testCases: BlackBox.TestCase[] = [ + { + from: '[F]oo bar', + inputs: 'h', + to: '[F]oo bar', + }, + { + from: 'F[o]o bar', + inputs: 'h', + to: '~[Fo]o bar', + }, + { + from: '[Fo]o bar', + inputs: 'h', + to: '[F]oo bar', + }, + { + from: '~[F]oo bar', + inputs: 'h', + to: '~[F]oo bar', + }, + ]; + + for (let i = 0; i < testCases.length; i++) { + BlackBox.run(testCases[i]); + } +}); diff --git a/test/ModeVisual/l.test.ts b/test/ModeVisual/l.test.ts new file mode 100644 index 00000000..e0f19ca0 --- /dev/null +++ b/test/ModeVisual/l.test.ts @@ -0,0 +1,30 @@ +import * as BlackBox from '../Framework/BlackBox'; + +suite('Visual: l', () => { + const testCases: BlackBox.TestCase[] = [ + { + from: 'Foo ba~[r]', + inputs: 'l', + to: 'Foo ba[r]', + }, + { + from: 'Foo b~[a]r', + inputs: 'l', + to: 'Foo b[ar]', + }, + { + from: 'Foo b~[ar]', + inputs: 'l', + to: 'Foo ba~[r]', + }, + { + from: 'Foo ba[r]', + inputs: 'l', + to: 'Foo ba[r]', + }, + ]; + + for (let i = 0; i < testCases.length; i++) { + BlackBox.run(testCases[i]); + } +});