r91913 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91912‎ | r91913 | r91914 >
Date:21:38, 11 July 2011
Author:inez
Status:deferred
Tags:
Comment:
Test for Content.slice with arguments passed
Modified paths:
  • /trunk/parsers/wikidom/tests/annotations/test.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/tests/annotations/test.js
@@ -162,7 +162,10 @@
163163 equals( content.getLength(), 66 );
164164 } );
165165
166 -test( '', function() {
167 - var data = content.slice().data;
168 - deepEqual( data, [["T",{"type":"italic"}],["h",{"type":"italic"}],["i",{"type":"italic"}],["s",{"type":"italic"}]," ","i","s"," ",["a",{"type":"xlink","data":{"url":"http://www.a.com"}}],[" ",{"type":"xlink","data":{"url":"http://www.a.com"}}],["t",{"type":"xlink","data":{"url":"http://www.a.com"}},{"type":"bold"}],["e",{"type":"xlink","data":{"url":"http://www.a.com"}},{"type":"bold"}],["s",{"type":"xlink","data":{"url":"http://www.a.com"}},{"type":"bold"}],["t",{"type":"xlink","data":{"url":"http://www.a.com"}},{"type":"bold"}]," ","p","a","r","a","g","r","a","p","h","!","\u000a","P","a","r","a","g","r","a","p","h","s"," ",["c",{"type":"italic"}],["a",{"type":"italic"}],["n",{"type":"italic"}]," ","h","a","v","e"," ",["m",{"type":"bold"}],["o",{"type":"bold"}],["r",{"type":"bold"}],["e",{"type":"bold"}]," ","t","h","a","n"," ","o","n","e"," ","l","i","n","e",".","\u000a"] );
 166+test( 'slice without arguments returns correct Content', function() {
 167+ deepEqual( content.slice().data, [["T",{"type":"italic"}],["h",{"type":"italic"}],["i",{"type":"italic"}],["s",{"type":"italic"}]," ","i","s"," ",["a",{"type":"xlink","data":{"url":"http://www.a.com"}}],[" ",{"type":"xlink","data":{"url":"http://www.a.com"}}],["t",{"type":"xlink","data":{"url":"http://www.a.com"}},{"type":"bold"}],["e",{"type":"xlink","data":{"url":"http://www.a.com"}},{"type":"bold"}],["s",{"type":"xlink","data":{"url":"http://www.a.com"}},{"type":"bold"}],["t",{"type":"xlink","data":{"url":"http://www.a.com"}},{"type":"bold"}]," ","p","a","r","a","g","r","a","p","h","!","\u000a","P","a","r","a","g","r","a","p","h","s"," ",["c",{"type":"italic"}],["a",{"type":"italic"}],["n",{"type":"italic"}]," ","h","a","v","e"," ",["m",{"type":"bold"}],["o",{"type":"bold"}],["r",{"type":"bold"}],["e",{"type":"bold"}]," ","t","h","a","n"," ","o","n","e"," ","l","i","n","e",".","\u000a"] );
 168+} );
 169+
 170+test( 'slice with arguments returns correct Content', function() {
 171+ deepEqual( content.slice(3, 10).data, [["s",{"type":"italic"}]," ","i","s"," ",["a",{"type":"xlink","data":{"url":"http://www.a.com"}}],[" ",{"type":"xlink","data":{"url":"http://www.a.com"}}]] );
169172 } );
\ No newline at end of file

Status & tagging log