r92208 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92207‎ | r92208 | r92209 >
Date:22:30, 14 July 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Reorganized annotation tests
Modified paths:
  • /trunk/parsers/wikidom/tests/annotations/test.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/tests/annotations/test.js
@@ -95,39 +95,33 @@
9696 content.remove( 5, 8 );
9797 } );
9898
99 -test( 'Content.substring', 5, function() {
 99+test( 'Content access', 8, function() {
100100 equal(
101101 content.substring( 3, 39 ),
102102 's is a test paragraph!\nParagraphs ca',
103 - 'Returns correct plain text'
 103+ 'Content.substring returns correct plain text when called with start and end arguments'
104104 );
105105 equal(
106106 content.substring( 39 ),
107107 'n have more than one line.',
108 - 'Uses data length if end is not given'
 108+ 'Content.substring uses data length if called without end argument'
109109 );
110110 equal(
111111 content.substring( -10, 10 ),
112112 'This is a ',
113 - 'Clamps negetive start arguments'
 113+ 'Content.substring clamps negetive start arguments'
114114 );
115115 equal(
116116 content.substring( 39, 100000000000 ),
117117 'n have more than one line.',
118 - 'Clamps out of range end arguments'
 118+ 'Content.substring clamps out of range end arguments'
119119 );
120120 equal(
121121 content.substring(),
122122 'This is a test paragraph!\nParagraphs can have more than one line.',
123 - 'Called without arguments returns all text'
 123+ 'Content.substring returns all text when called without arguments'
124124 );
125 -} );
126 -
127 -test( 'Content.getLength', 1, function() {
128 - equal( content.getLength(), 65, 'Returns correct length' );
129 -} );
130 -
131 -test( 'Content.slice', 2, function() {
 125+ equal( content.getLength(), 65, 'Content.getLength returns correct length' );
132126 deepEqual(
133127 content.slice().data,
134128 [
@@ -197,7 +191,7 @@
198192 "e",
199193 "."
200194 ],
201 - 'Called without arguments returns all data'
 195+ 'Content.slice returns all data when called without arguments'
202196 );
203197 deepEqual(
204198 content.slice( 3, 10 ).data,
@@ -210,6 +204,6 @@
211205 ["a", { "type": "xlink", "data": { "url":"http://www.a.com" } }],
212206 [" ", { "type": "xlink", "data": { "url":"http://www.a.com" } }]
213207 ],
214 - 'Called with start and end returns range of data'
 208+ 'Content.slice returns correct range of data when called with start and end arguments'
215209 );
216210 } );

Status & tagging log