Added tests for selectAWord

This commit is contained in:
Sergi Mansilla 2011-11-24 23:22:49 +01:00
commit 5639aa971e

View file

@ -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();