Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
add tests #38
Browse files Browse the repository at this point in the history
  • Loading branch information
74th committed Jun 15, 2016
1 parent 5bedcab commit 23dfea0
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 60 deletions.
61 changes: 1 addition & 60 deletions test/vim/DeleteTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
},
};
// dw cw and others are in TextObjectMotion.js
83 changes: 83 additions & 0 deletions test/vim/TextObjectMotions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"] = {
Expand Down Expand Up @@ -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",
],
}
};

Expand Down

0 comments on commit 23dfea0

Please sign in to comment.