r103358 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103357‎ | r103358 | r103359 >
Date:19:26, 16 November 2011
Author:tparscal
Status:ok
Tags:
Comment:
Fixed test data in response to r103354
Modified paths:
  • /trunk/extensions/VisualEditor/tests/es/es.DocumentNode.test.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/tests/es/es.DocumentNode.test.js
@@ -195,7 +195,7 @@
196196 {
197197 'node': root2,
198198 'input': new es.Range( 0, 10 ),
199 - 'output': [{ 'node': f } ],
 199+ 'output': [{ 'node': f, 'globalRange': new es.Range( 0, 10 ) } ],
200200 'desc': 'Range starting before the beginning of a node and ending past the end'
201201 },
202202 // Test 6
@@ -290,7 +290,7 @@
291291 'node': root2,
292292 'input': new es.Range( 0, 11 ),
293293 'output': [
294 - { 'node': f },
 294+ { 'node': f, 'globalRange': new es.Range( 0, 10 ) },
295295 { 'node': g, 'range': new es.Range( 0, 0 ), 'globalRange': new es.Range( 11, 11 ) }
296296 ],
297297 'desc': 'Range starting before the beginning of the first node and ending at the beginning of the second node'
@@ -300,7 +300,7 @@
301301 'node': root2,
302302 'input': new es.Range( 0, 14 ),
303303 'output': [
304 - { 'node': f },
 304+ { 'node': f, 'globalRange': new es.Range( 0, 10 ) },
305305 { 'node': g, 'range': new es.Range( 0, 3 ), 'globalRange': new es.Range( 11, 14 ) }
306306 ],
307307 'desc': 'Range starting before the beginning of the first node and ending in the middle of the second node'
@@ -310,7 +310,7 @@
311311 'node': root2,
312312 'input': new es.Range( 0, 19 ),
313313 'output': [
314 - { 'node': f },
 314+ { 'node': f, 'globalRange': new es.Range( 0, 10 ) },
315315 { 'node': g, 'range': new es.Range( 0, 8 ), 'globalRange': new es.Range( 11, 19 ) }
316316 ],
317317 'desc': 'Range starting before the beginning of the first node and ending at the end of the second node'
@@ -320,8 +320,8 @@
321321 'node': root2,
322322 'input': new es.Range( 0, 20 ),
323323 'output': [
324 - { 'node': f },
325 - { 'node': g }
 324+ { 'node': f, 'globalRange': new es.Range( 0, 10 ) },
 325+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) }
326326 ],
327327 'desc': 'Range starting before the beginning of the first node and ending between the second and the third node'
328328 },
@@ -330,8 +330,8 @@
331331 'node': root2,
332332 'input': new es.Range( 0, 21 ),
333333 'output': [
334 - { 'node': f },
335 - { 'node': g },
 334+ { 'node': f, 'globalRange': new es.Range( 0, 10 ) },
 335+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
336336 { 'node': h, 'range': new es.Range( 0, 0 ), 'globalRange': new es.Range( 21, 21 ) }
337337 ],
338338 'desc': 'Range starting before the beginning of the first node and ending at the beginning of the third node'
@@ -341,8 +341,8 @@
342342 'node': root2,
343343 'input': new es.Range( 0, 27 ),
344344 'output': [
345 - { 'node': f },
346 - { 'node': g },
 345+ { 'node': f, 'globalRange': new es.Range( 0, 10 ) },
 346+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
347347 { 'node': h, 'range': new es.Range( 0, 6 ), 'globalRange': new es.Range( 21, 27 ) }
348348 ],
349349 'desc': 'Range starting before the beginning of the first node and ending in the middle of the third node'
@@ -352,8 +352,8 @@
353353 'node': root2,
354354 'input': new es.Range( 0, 29 ),
355355 'output': [
356 - { 'node': f },
357 - { 'node': g },
 356+ { 'node': f, 'globalRange': new es.Range( 0, 10 ) },
 357+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
358358 { 'node': h, 'range': new es.Range( 0, 8 ), 'globalRange': new es.Range( 21, 29 ) }
359359 ],
360360 'desc': 'Range starting before the beginning of the first node and ending at the end of the third node'
@@ -363,9 +363,9 @@
364364 'node': root2,
365365 'input': new es.Range( 0, 30 ),
366366 'output': [
367 - { 'node': f },
368 - { 'node': g },
369 - { 'node': h }
 367+ { 'node': f, 'globalRange': new es.Range( 0, 10 ) },
 368+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
 369+ { 'node': h, 'globalRange': new es.Range( 20, 30 ) }
370370 ],
371371 'desc': 'Range starting before the beginning of the first node and ending past the end of the third node'
372372 },
@@ -405,7 +405,7 @@
406406 'input': new es.Range( 1, 20 ),
407407 'output': [
408408 { 'node': f, 'range': new es.Range( 0, 8 ), 'globalRange': new es.Range( 1, 9 ) },
409 - { 'node': g }
 409+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) }
410410 ],
411411 'desc': 'Range starting at the beginning of the first node and ending between the second and the third node'
412412 },
@@ -415,7 +415,7 @@
416416 'input': new es.Range( 1, 21 ),
417417 'output': [
418418 { 'node': f, 'range': new es.Range( 0, 8 ), 'globalRange': new es.Range( 1, 9 ) },
419 - { 'node': g },
 419+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
420420 { 'node': h, 'range': new es.Range( 0, 0 ), 'globalRange': new es.Range( 21, 21 ) }
421421 ],
422422 'desc': 'Range starting at the beginning of the first node and ending at the beginning of the third node'
@@ -426,7 +426,7 @@
427427 'input': new es.Range( 1, 27 ),
428428 'output': [
429429 { 'node': f, 'range': new es.Range( 0, 8 ), 'globalRange': new es.Range( 1, 9 ) },
430 - { 'node': g },
 430+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
431431 { 'node': h, 'range': new es.Range( 0, 6 ), 'globalRange': new es.Range( 21, 27 ) }
432432 ],
433433 'desc': 'Range starting at the beginning of the first node and ending in the middle of the third node'
@@ -437,7 +437,7 @@
438438 'input': new es.Range( 1, 29 ),
439439 'output': [
440440 { 'node': f, 'range': new es.Range( 0, 8 ), 'globalRange': new es.Range( 1, 9 ) },
441 - { 'node': g },
 441+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
442442 { 'node': h, 'range': new es.Range( 0, 8 ), 'globalRange': new es.Range( 21, 29 ) }
443443 ],
444444 'desc': 'Range starting at the beginning of the first node and ending at the end of the third node'
@@ -448,8 +448,8 @@
449449 'input': new es.Range( 1, 30 ),
450450 'output': [
451451 { 'node': f, 'range': new es.Range( 0, 8 ), 'globalRange': new es.Range( 1, 9 ) },
452 - { 'node': g },
453 - { 'node': h }
 452+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
 453+ { 'node': h, 'globalRange': new es.Range( 20, 30 ) }
454454 ],
455455 'desc': 'Range starting at the beginning of the first node and ending past the end of the third node'
456456 },
@@ -489,7 +489,7 @@
490490 'input': new es.Range( 5, 20 ),
491491 'output': [
492492 { 'node': f, 'range': new es.Range( 4, 8 ), 'globalRange': new es.Range( 5, 9 ) },
493 - { 'node': g }
 493+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) }
494494 ],
495495 'desc': 'Range starting in the middle of the first node and ending between the second and the third node'
496496 },
@@ -499,7 +499,7 @@
500500 'input': new es.Range( 5, 21 ),
501501 'output': [
502502 { 'node': f, 'range': new es.Range( 4, 8 ), 'globalRange': new es.Range( 5, 9 ) },
503 - { 'node': g },
 503+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
504504 { 'node': h, 'range': new es.Range( 0, 0 ), 'globalRange': new es.Range( 21, 21 ) }
505505 ],
506506 'desc': 'Range starting in the middle of the first node and ending at the beginning of the third node'
@@ -510,7 +510,7 @@
511511 'input': new es.Range( 5, 27 ),
512512 'output': [
513513 { 'node': f, 'range': new es.Range( 4, 8 ), 'globalRange': new es.Range( 5, 9 ) },
514 - { 'node': g },
 514+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
515515 { 'node': h, 'range': new es.Range( 0, 6 ), 'globalRange': new es.Range( 21, 27 ) }
516516 ],
517517 'desc': 'Range starting in the middle of the first node and ending in the middle of the third node'
@@ -521,7 +521,7 @@
522522 'input': new es.Range( 5, 29 ),
523523 'output': [
524524 { 'node': f, 'range': new es.Range( 4, 8 ), 'globalRange': new es.Range( 5, 9 ) },
525 - { 'node': g },
 525+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
526526 { 'node': h, 'range': new es.Range( 0, 8 ), 'globalRange': new es.Range( 21, 29 ) }
527527 ],
528528 'desc': 'Range starting in the middle of the first node and ending at the end of the third node'
@@ -532,8 +532,8 @@
533533 'input': new es.Range( 5, 30 ),
534534 'output': [
535535 { 'node': f, 'range': new es.Range( 4, 8 ), 'globalRange': new es.Range( 5, 9 ) },
536 - { 'node': g },
537 - { 'node': h }
 536+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
 537+ { 'node': h, 'globalRange': new es.Range( 20, 30 ) }
538538 ],
539539 'desc': 'Range starting in the middle of the first node and ending past the end of the third node'
540540 },
@@ -573,7 +573,7 @@
574574 'input': new es.Range( 9, 20 ),
575575 'output': [
576576 { 'node': f, 'range': new es.Range( 8, 8 ), 'globalRange': new es.Range( 9, 9 ) },
577 - { 'node': g }
 577+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) }
578578 ],
579579 'desc': 'Range starting at the end of the first node and ending between the second and the third node'
580580 },
@@ -583,7 +583,7 @@
584584 'input': new es.Range( 9, 21 ),
585585 'output': [
586586 { 'node': f, 'range': new es.Range( 8, 8 ), 'globalRange': new es.Range( 9, 9 ) },
587 - { 'node': g },
 587+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
588588 { 'node': h, 'range': new es.Range( 0, 0 ), 'globalRange': new es.Range( 21, 21 ) }
589589 ],
590590 'desc': 'Range starting at the end of the first node and ending at the beginning of the third node'
@@ -594,7 +594,7 @@
595595 'input': new es.Range( 9, 27 ),
596596 'output': [
597597 { 'node': f, 'range': new es.Range( 8, 8 ), 'globalRange': new es.Range( 9, 9 ) },
598 - { 'node': g },
 598+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
599599 { 'node': h, 'range': new es.Range( 0, 6 ), 'globalRange': new es.Range( 21, 27 ) }
600600 ],
601601 'desc': 'Range starting at the end of the first node and ending in the middle of the third node'
@@ -605,7 +605,7 @@
606606 'input': new es.Range( 9, 29 ),
607607 'output': [
608608 { 'node': f, 'range': new es.Range( 8, 8 ), 'globalRange': new es.Range( 9, 9 ) },
609 - { 'node': g },
 609+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
610610 { 'node': h, 'range': new es.Range( 0, 8 ), 'globalRange': new es.Range( 21, 29 ) }
611611 ],
612612 'desc': 'Range starting at the end of the first node and ending at the end of the third node'
@@ -616,8 +616,8 @@
617617 'input': new es.Range( 9, 30 ),
618618 'output': [
619619 { 'node': f, 'range': new es.Range( 8, 8 ), 'globalRange': new es.Range( 9, 9 ) },
620 - { 'node': g },
621 - { 'node': h }
 620+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
 621+ { 'node': h, 'globalRange': new es.Range( 20, 30 ) }
622622 ],
623623 'desc': 'Range starting at the end of the first node and ending past the end of the third node'
624624 },
@@ -626,7 +626,7 @@
627627 'node': root2,
628628 'input': new es.Range( 10, 21 ),
629629 'output': [
630 - { 'node': g },
 630+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
631631 { 'node': h, 'range': new es.Range( 0, 0 ), 'globalRange': new es.Range( 21, 21 ) }
632632 ],
633633 'desc': 'Range starting between the first and the second node and ending at the beginning of the third node'
@@ -636,7 +636,7 @@
637637 'node': root2,
638638 'input': new es.Range( 10, 27 ),
639639 'output': [
640 - { 'node': g },
 640+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
641641 { 'node': h, 'range': new es.Range( 0, 6 ), 'globalRange': new es.Range( 21, 27 ) }
642642 ],
643643 'desc': 'Range starting between the first and the second node and ending in the middle of the third node'
@@ -646,7 +646,7 @@
647647 'node': root2,
648648 'input': new es.Range( 10, 29 ),
649649 'output': [
650 - { 'node': g },
 650+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
651651 { 'node': h, 'range': new es.Range( 0, 8 ), 'globalRange': new es.Range( 21, 29 ) }
652652 ],
653653 'desc': 'Range starting between the first and the second node and ending at the end of the third node'
@@ -656,8 +656,8 @@
657657 'node': root2,
658658 'input': new es.Range( 10, 30 ),
659659 'output': [
660 - { 'node': g },
661 - { 'node': h }
 660+ { 'node': g, 'globalRange': new es.Range( 10, 20 ) },
 661+ { 'node': h, 'globalRange': new es.Range( 20, 30 ) }
662662 ],
663663 'desc': 'Range starting between the first and the second node and ending past the end of the third node'
664664 },
@@ -697,7 +697,7 @@
698698 'input': new es.Range( 11, 30 ),
699699 'output': [
700700 { 'node': g, 'range': new es.Range( 0, 8 ), 'globalRange': new es.Range( 11, 19 ) },
701 - { 'node': h }
 701+ { 'node': h, 'globalRange': new es.Range( 20, 30 ) }
702702 ],
703703 'desc': 'Range starting at the beginning of the second node and ending past the end of the third node'
704704 },
@@ -737,7 +737,7 @@
738738 'input': new es.Range( 14, 30 ),
739739 'output': [
740740 { 'node': g, 'range': new es.Range( 3, 8 ), 'globalRange': new es.Range( 14, 19 ) },
741 - { 'node': h }
 741+ { 'node': h, 'globalRange': new es.Range( 20, 30 ) }
742742 ],
743743 'desc': 'Range starting in the middle of the second node and ending past the end of the third node'
744744 },
@@ -777,7 +777,7 @@
778778 'input': new es.Range( 19, 30 ),
779779 'output': [
780780 { 'node': g, 'range': new es.Range( 8, 8 ), 'globalRange': new es.Range( 19, 19 ) },
781 - { 'node': h }
 781+ { 'node': h, 'globalRange': new es.Range( 20, 30 ) }
782782 ],
783783 'desc': 'Range starting at the end of the second node and ending past the end of the third node'
784784 },
@@ -849,7 +849,7 @@
850850 'input': new es.Range( 3, 33 ),
851851 'output': [
852852 { 'node': big.children[0], 'range': new es.Range( 2, 3 ), 'globalRange': new es.Range( 3, 4 ) },
853 - { 'node': big.children[1] },
 853+ { 'node': big.children[1], 'globalRange': new es.Range( 5, 31 ) },
854854 { 'node': big.children[2], 'range': new es.Range( 0, 1 ), 'globalRange': new es.Range( 32, 33 ) }
855855 ],
856856 'desc': 'Select from before the c to after the h'

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103354In selectNodes(), also set globalRange for fully-covered nodes. There is no s...catrope19:02, 16 November 2011

Status & tagging log