@@ -867,7 +867,7 @@ test("jQuery.each(Object,Function)", function() {
867867 f [ i ] = "baz" ;
868868 } ) ;
869869 equals ( "baz" , f . foo , "Loop over a function" ) ;
870-
870+
871871 var stylesheet_count = 0 ;
872872 jQuery . each ( document . styleSheets , function ( i ) {
873873 stylesheet_count ++ ;
@@ -984,6 +984,26 @@ test("jQuery.parseJSON", function(){
984984 }
985985} ) ;
986986
987+ test ( "jQuery.parseXML" , 4 , function ( ) {
988+ var xml , tmp ;
989+ try {
990+ xml = jQuery . parseXML ( "<p>A <b>well-formed</b> xml string</p>" ) ;
991+ tmp = xml . getElementsByTagName ( "p" ) [ 0 ] ;
992+ ok ( ! ! tmp , "<p> present in document" ) ;
993+ tmp = tmp . getElementsByTagName ( "b" ) [ 0 ] ;
994+ ok ( ! ! tmp , "<b> present in document" ) ;
995+ strictEqual ( tmp . childNodes [ 0 ] . nodeValue , "well-formed" , "<b> text is as expected" ) ;
996+ } catch ( e ) {
997+ strictEqual ( e , undefined , "unexpected error" ) ;
998+ }
999+ try {
1000+ xml = jQuery . parseXML ( "<p>Not a <<b>well-formed</b> xml string</p>" ) ;
1001+ ok ( false , "invalid xml not detected" ) ;
1002+ } catch ( e ) {
1003+ strictEqual ( e , "Invalid XML: <p>Not a <<b>well-formed</b> xml string</p>" , "invalid xml detected" ) ;
1004+ }
1005+ } ) ;
1006+
9871007test ( "jQuery.sub() - Static Methods" , function ( ) {
9881008 expect ( 18 ) ;
9891009 var Subclass = jQuery . sub ( ) ;
@@ -1108,7 +1128,7 @@ test("jQuery.sub() - .fn Methods", function(){
11081128test ( "jQuery.camelCase()" , function ( ) {
11091129
11101130 var tests = {
1111- "foo-bar" : "fooBar" ,
1131+ "foo-bar" : "fooBar" ,
11121132 "foo-bar-baz" : "fooBarBaz"
11131133 } ;
11141134
0 commit comments