diff --git a/test/index.js b/test/index.js index 5fd9dec..f6aa40f 100644 --- a/test/index.js +++ b/test/index.js @@ -93,4 +93,29 @@ test('functions', () => { assert.is(fn(foo, 'hello', [[fn], 'world']), 'hello world'); }); +test('arrays (nested with falsy)', () => { + assert.is(fn(['foo', [null, [undefined, [false, [0, ['']]]]]]), 'foo'); + assert.is(fn(['foo', [null, 'bar', [undefined, false, ['baz', 0, '']]]]), 'foo bar baz'); +}); + +test('symbols', () => { + assert.is(fn(Symbol('foo')), ''); + assert.is(fn(Symbol('foo'), Symbol('bar')), ''); + assert.is(fn('foo', Symbol('bar'), 'baz'), 'foo baz'); + assert.is(fn(['foo', Symbol('bar'), 'baz']), 'foo baz'); + assert.is(fn({ [Symbol('foo')]: true }), ''); +}); + +test('objects (inherited keys)', () => { + const parent = { inherited: true }; + const child = Object.create(parent); + child.own = true; + assert.is(fn(child), 'own inherited'); + + const parentFalsy = { inherited: false }; + const childTruthy = Object.create(parentFalsy); + childTruthy.own = true; + assert.is(fn(childTruthy), 'own'); +}); + test.run();