Skip to content

Commit

Permalink
add tests for nesting arrays and dictionaries
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed May 5, 2017
1 parent 4683c6c commit 31645bc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests.js
Expand Up @@ -50,3 +50,17 @@ test('it can parse a string with escapes', t => {
const string = parse(plist)[0]
t.equal(string, 'she said "not me!"')
})

test('it can parse nested arrays', t => {
t.plan(1)
const plist = '("fox", ("glove", ("army")))'
const array = parse(plist)
t.deepEqual(array, ['fox', ['glove', ['army']]])
})

test('it can parse a nested object', t => {
t.plan(1)
const plist = '{"one" = {"two" = "three"}}'
const object = parse(plist)
t.equal(object.one.two, 'three')
})

0 comments on commit 31645bc

Please sign in to comment.