File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
on :
4
4
push :
5
+ pull_request :
5
6
6
7
jobs :
7
8
build :
Original file line number Diff line number Diff line change @@ -220,5 +220,7 @@ function parsePlistXML (node) {
220
220
221
221
} else if ( node . nodeName === 'false' ) {
222
222
return false ;
223
+ } else {
224
+ throw new Error ( 'Invalid PLIST tag ' + node . nodeName ) ;
223
225
}
224
226
}
Original file line number Diff line number Diff line change @@ -519,4 +519,30 @@ int main(int argc, char *argv[])
519
519
} ) ;
520
520
} ) ;
521
521
} ) ;
522
+ describe ( 'invalid formats' , function ( ) {
523
+ it ( 'should fail parsing invalid xml plist' , function ( ) {
524
+ var xml = multiline ( function ( ) {
525
+ /*
526
+ <?xml version="1.0" encoding="UTF-8"?>
527
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
528
+ <plist version="1.0">
529
+ <dict>
530
+ <key>test</key>
531
+ <strong>Testing</strong>
532
+ <key>bar</key>
533
+ <string></string>
534
+ </dict>
535
+ </plist>
536
+ */
537
+ } ) ;
538
+ assert . throws ( function ( ) {
539
+ var parsed = parse ( xml ) ;
540
+ } ) ;
541
+ } ) ;
542
+ it ( 'ensure empty strings arent valid plist' , function ( ) {
543
+ assert . throws ( function ( ) {
544
+ var parsed = parse ( '' ) ;
545
+ } ) ;
546
+ } ) ;
547
+ } ) ;
522
548
} ) ;
You can’t perform that action at this time.
0 commit comments