From 23dfea0b6945aaabf8078cbf3c064e5310dbaad7 Mon Sep 17 00:00:00 2001 From: 74th Date: Thu, 16 Jun 2016 08:39:01 +0900 Subject: [PATCH] add tests #38 --- test/vim/DeleteTests.ts | 61 +------------------------ test/vim/TextObjectMotions.ts | 83 +++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 60 deletions(-) diff --git a/test/vim/DeleteTests.ts b/test/vim/DeleteTests.ts index 64c7c9a..f733175 100644 --- a/test/vim/DeleteTests.ts +++ b/test/vim/DeleteTests.ts @@ -7,63 +7,4 @@ DeleteTests["delete charactor"] = { "out": ["a|c"], } }; - -DeleteTests["delete word"] = { - "dw:delete one word": { - "in": ["aaa |bbb ccc"], - "key": "dw", - "out": ["aaa |ccc"], - }, - "dw:delete first word": { - "in": ["|aaa bbb ccc"], - "key": "dw", - "out": ["|bbb ccc"], - }, - "dw:delete last word": { - "in": ["aaa bbb |ccc"], - "key": "dw", - "out": ["aaa bbb| "], - }, - "dw:delete a word at end of line": { - "in": [ - "aaa |BCD", - "ccc ddd", - ], - "key": "dw", - "out": [ - "aaa| ", - "ccc ddd", - ], - }, - "dw:delete a word at end of document": { - "in": [ - "aaa bbb", - "ccc |ddd", - ], - "key": "dw", - "out": [ - "aaa bbb", - "ccc| ", - ], - }, - "dw:delete spaces tailled the word": { - "in": [ - "aaa |bbb ", - "ccc ddd", - ], - "key": "dw", - "out": [ - "aaa| ", - "ccc ddd", - ], - }, - "cw:do not cut spaces tailled the word": { - "in": [ - "aaa |bbb ccc", - ], - "key": "cweee_", - "out": [ - "aaa ee|e ccc", - ], - }, -}; \ No newline at end of file +// dw cw and others are in TextObjectMotion.js \ No newline at end of file diff --git a/test/vim/TextObjectMotions.ts b/test/vim/TextObjectMotions.ts index 4abe701..182fd8a 100644 --- a/test/vim/TextObjectMotions.ts +++ b/test/vim/TextObjectMotions.ts @@ -62,6 +62,76 @@ TextObjectMotions["w: N words forward"] = { "key": "w", "out": ["tree.|Len()"] }, + "dw:delete one word": { + "in": ["aaa |bbb ccc"], + "key": "dw", + "out": ["aaa |ccc"], + }, + "dw:delete first word": { + "in": ["|aaa bbb ccc"], + "key": "dw", + "out": ["|bbb ccc"], + }, + "dw:delete last word": { + "in": ["aaa bbb |ccc"], + "key": "dw", + "out": ["aaa bbb| "], + }, + "dw:delete a word at end of line": { + "in": [ + "aaa |BCD", + "ccc ddd", + ], + "key": "dw", + "out": [ + "aaa| ", + "ccc ddd", + ], + }, + "dw:delete a word at end of document": { + "in": [ + "aaa bbb", + "ccc |ddd", + ], + "key": "dw", + "out": [ + "aaa bbb", + "ccc| ", + ], + }, + "dw:delete spaces tailled the word": { + "in": [ + "aaa |bbb ", + "ccc ddd", + ], + "key": "dw", + "out": [ + "aaa| ", + "ccc ddd", + ], + }, + "dw:delete only one word in line": { + "in": [ + "aaa", + "|bbb", + "ccc" + ], + "key": "dw", + "out": [ + "aaa", + "|", + "ccc" + ], + }, + "cw:do not cut spaces tailled the word": { + "in": [ + "aaa |bbb ccc", + ], + "key": "cweee_", + "out": [ + "aaa ee|e ccc", + ], + }, } TextObjectMotions["NW:N blank-separated"] = { @@ -174,6 +244,19 @@ TextObjectMotions["Nb: N words backward"] = { "", "abd abd" ], + }, + "db:delete before a word if sursor in first character of a word": { + "in": [ + "zzz", + "aaa |bbb ccc", + "zzz", + ], + "key": "db", + "out": [ + "zzz", + "|bbb ccc", + "zzz", + ], } };