Index: trunk/extensions/VisualEditor/tests/es/es.DocumentNode.test.js |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | module( 'es/bases' ); |
3 | 3 | |
4 | | -function DocumentNodeStub( items, name, size ) { |
| 4 | +function DocumentBranchNodeStub( items, name, size ) { |
5 | 5 | // Inheritance |
6 | 6 | es.DocumentBranchNode.call( this, items ); |
7 | 7 | |
— | — | @@ -9,35 +9,35 @@ |
10 | 10 | this.size = size; |
11 | 11 | } |
12 | 12 | |
13 | | -DocumentNodeStub.prototype.getContentLength = function() { |
| 13 | +DocumentBranchNodeStub.prototype.getContentLength = function() { |
14 | 14 | return this.size; |
15 | 15 | }; |
16 | 16 | |
17 | | -DocumentNodeStub.prototype.getElementLength = function() { |
| 17 | +DocumentBranchNodeStub.prototype.getElementLength = function() { |
18 | 18 | // Mimic document data which has an opening and closing around the content |
19 | 19 | return this.size + 2; |
20 | 20 | }; |
21 | 21 | |
22 | | -es.extendClass( DocumentNodeStub, es.DocumentBranchNode ); |
| 22 | +es.extendClass( DocumentBranchNodeStub, es.DocumentBranchNode ); |
23 | 23 | |
24 | 24 | test( 'es.DocumentNode', function() { |
25 | 25 | |
26 | 26 | // Stub test |
27 | 27 | |
28 | 28 | strictEqual( |
29 | | - ( new DocumentNodeStub( [], 'a', 0 ) ).getElementLength(), |
| 29 | + ( new DocumentBranchNodeStub( [], 'a', 0 ) ).getElementLength(), |
30 | 30 | 2, |
31 | | - 'DocumentNodeStub.getElementLength() returns initialized length plus 2 for elements' |
| 31 | + 'DocumentBranchNodeStub.getElementLength() returns initialized length plus 2 for elements' |
32 | 32 | ); |
33 | 33 | |
34 | 34 | // Stubs |
35 | 35 | |
36 | | - var a = new DocumentNodeStub( [], 'a', 0 ), |
37 | | - b = new DocumentNodeStub( [], 'b', 1 ), |
38 | | - c = new DocumentNodeStub( [], 'c', 2 ), |
39 | | - d = new DocumentNodeStub( [], 'd', 3 ), |
40 | | - e = new DocumentNodeStub( [], 'e', 4 ), |
41 | | - root1 = new DocumentNodeStub( [a, b, c, d, e], 'root1', 20 ), |
| 36 | + var a = new DocumentBranchNodeStub( [], 'a', 0 ), |
| 37 | + b = new DocumentBranchNodeStub( [], 'b', 1 ), |
| 38 | + c = new DocumentBranchNodeStub( [], 'c', 2 ), |
| 39 | + d = new DocumentBranchNodeStub( [], 'd', 3 ), |
| 40 | + e = new DocumentBranchNodeStub( [], 'e', 4 ), |
| 41 | + root1 = new DocumentBranchNodeStub( [a, b, c, d, e], 'root1', 20 ), |
42 | 42 | i; |
43 | 43 | |
44 | 44 | // getRangeFromNode tests |
— | — | @@ -122,13 +122,14 @@ |
123 | 123 | //^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ |
124 | 124 | //0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
125 | 125 | // 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 |
126 | | - var f = new DocumentNodeStub( [], 'f', 8 ), |
127 | | - g = new DocumentNodeStub( [], 'g', 8 ), |
128 | | - h = new DocumentNodeStub( [], 'h', 8 ), |
129 | | - root2 = new DocumentNodeStub( [f, g, h], 'root2', 30 ); |
| 126 | + var f = new DocumentBranchNodeStub( [], 'f', 8 ), |
| 127 | + g = new DocumentBranchNodeStub( [], 'g', 8 ), |
| 128 | + h = new DocumentBranchNodeStub( [], 'h', 8 ), |
| 129 | + root2 = new DocumentBranchNodeStub( [f, g, h], 'root2', 30 ); |
130 | 130 | // FIXME: QUnit thinks f == g because both are empty arrays. Rawr. |
131 | 131 | // TODO make sure there is a test case for everything that is special-cased in the code |
132 | | - // TODO also nest with a more complicated nested structure, like the one from es.DocumentModel.test.js |
| 132 | + // TODO also nest with a more complicated nested structure, like the one from |
| 133 | + // es.DocumentModel.test.js |
133 | 134 | |
134 | 135 | // Possible positions are: |
135 | 136 | // * before beginning |
— | — | @@ -243,7 +244,7 @@ |
244 | 245 | { 'node': g }, |
245 | 246 | { 'node': h, 'range': new es.Range( 0, 4 ) } |
246 | 247 | ], |
247 | | - 'desc': 'Range starting in the middle of the first node and ending in the middle of the third' |
| 248 | + 'desc': 'Range from the middle of the first node to the middle of the third' |
248 | 249 | }, |
249 | 250 | { |
250 | 251 | 'node': root2, |
— | — | @@ -252,7 +253,7 @@ |
253 | 254 | { 'node': f, 'range': new es.Range( 4, 8 ) }, |
254 | 255 | { 'node': g, 'range': new es.Range( 0, 0 ) } |
255 | 256 | ], |
256 | | - 'desc': 'Range starting in the middle of a node and ending at the beginning of the second' |
| 257 | + 'desc': 'Range from the middle of a node to the beginning of the second' |
257 | 258 | }, |
258 | 259 | { |
259 | 260 | 'node': root2, |
— | — | @@ -261,7 +262,7 @@ |
262 | 263 | { 'node': f, 'range': new es.Range( 4, 8 ) }, |
263 | 264 | { 'node': g, 'range': new es.Range( 0, 1 ) } |
264 | 265 | ], |
265 | | - 'desc': 'Range starting in the middle of a node and ending after the first character of the second' |
| 266 | + 'desc': 'Range from in the middle of a node to the first character of the second' |
266 | 267 | }, |
267 | 268 | { |
268 | 269 | 'node': root2, |
— | — | @@ -270,7 +271,7 @@ |
271 | 272 | { 'node': f, 'range': new es.Range( 7, 8 ) }, |
272 | 273 | { 'node': g, 'range': new es.Range( 0, 5 ) } |
273 | 274 | ], |
274 | | - 'desc': 'Range starting before the last character of a node and ending in the middle of the next node' |
| 275 | + 'desc': 'Range from before the last character of a node to the middle of the next node' |
275 | 276 | }, |
276 | 277 | { |
277 | 278 | 'node': root2, |
— | — | @@ -279,7 +280,7 @@ |
280 | 281 | { 'node': f, 'range': new es.Range( 8, 8 ) }, |
281 | 282 | { 'node': g, 'range': new es.Range( 0, 5 ) } |
282 | 283 | ], |
283 | | - 'desc': 'Range starting at the end of a node and ending in the middle of the next node' |
| 284 | + 'desc': 'Range from at the end of a node to the middle of the next node' |
284 | 285 | } |
285 | 286 | ]; |
286 | 287 | |
Index: trunk/extensions/VisualEditor/tests/es/es.DocumentModel.test.js |
— | — | @@ -668,8 +668,7 @@ |
669 | 669 | }, |
670 | 670 | { 'type': 'retain', 'length': 26 } |
671 | 671 | ], |
672 | | - 'prepareInsertion splits up paragraph when inserting a paragraph closing and opening into' + |
673 | | - 'a paragraph' |
| 672 | + 'prepareInsertion splits paragraph when inserting a paragraph closing and opening inside it' |
674 | 673 | ); |
675 | 674 | |
676 | 675 | // Test 7 |