From 31645bcca2647d0ebd38149d602eeb56d705117f Mon Sep 17 00:00:00 2001 From: chee Date: Fri, 5 May 2017 02:23:20 +0100 Subject: [PATCH] add tests for nesting arrays and dictionaries --- tests.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests.js b/tests.js index c4c7f2a..2f024ef 100644 --- a/tests.js +++ b/tests.js @@ -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') +})