Added tests for selectAWord
This commit is contained in:
parent
bb7fd9bb66
commit
5639aa971e
1 changed files with 48 additions and 36 deletions
|
|
@ -248,6 +248,18 @@ module.exports = {
|
||||||
assert.position(range.end, 0, 12);
|
assert.position(range.end, 0, 12);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"test: select word with cursor in word including right whitespace should select the word" : function() {
|
||||||
|
var session = new EditSession("Juhu Kinners 123");
|
||||||
|
var selection = session.getSelection();
|
||||||
|
|
||||||
|
selection.moveCursorTo(0, 8);
|
||||||
|
selection.selectAWord();
|
||||||
|
|
||||||
|
var range = selection.getRange();
|
||||||
|
assert.position(range.start, 0, 5);
|
||||||
|
assert.position(range.end, 0, 18);
|
||||||
|
},
|
||||||
|
|
||||||
"test: select word with cursor betwen white space and word should select the word" : function() {
|
"test: select word with cursor betwen white space and word should select the word" : function() {
|
||||||
var session = new EditSession("Juhu Kinners");
|
var session = new EditSession("Juhu Kinners");
|
||||||
var selection = session.getSelection();
|
var selection = session.getSelection();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue