Skip to content

Commit

Permalink
Add more tests - TooTallNate#79
Browse files Browse the repository at this point in the history
  • Loading branch information
akofman committed Sep 21, 2016
1 parent 4163d73 commit 3f256fd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,23 @@ describe('plist', function () {
assert.ok(isEmpty(parsed));
});

it('should prevent errors when empty <key></key> in a dictionary', function() {
var xml = multiline(function() {/*
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key></key>
<string>should never be added</string>
<key>foo</key>
<string>bar</string>
</dict>
</plist>
*/});
var parsed = parse(xml);
assert.deepEqual(parsed, {foo: 'bar'});
});

it('should parse an empty <key></key> and <string></string> in dictionary with more data', function() {
var xml = multiline(function() {/*
<?xml version="1.0" encoding="UTF-8"?>
Expand Down

0 comments on commit 3f256fd

Please sign in to comment.