'use strict';
const assert = require('assert');
const format = require('../');
// const symbol = Symbol('foo');

// assert.equal(format([]), '');
// assert.equal(format(['']), '');
// assert.equal(format([[]]), '[]');
// assert.equal(format([{}]), '{}');
// assert.equal(format([null]), 'null');
// assert.equal(format([true]), 'true');
// assert.equal(format([false]), 'false');
// assert.equal(format(['test']), 'test');

// // // CHECKME this is for console.log() compatibility - but is it *right*?
// assert.equal(format(['foo', 'bar', 'baz']), 'foo bar baz');

// // ES6 Symbol handling
// // assert.equal(format([symbol]), 'Symbol(foo)');
// // assert.equal(format(['foo', symbol]), 'foo Symbol(foo)');
// // assert.equal(format(['%s', symbol]), 'Symbol(foo)');
// // assert.equal(format(['%j', symbol]), 'undefined');
// // assert.throws(function() {
// //   format(['%d', symbol]);
// // }, TypeError);

// assert.equal(format(['%d', 42.0]), '42');
// assert.equal(format(['%d', 42]), '42');
// assert.equal(format(['%s', 42]), '42');
// assert.equal(format(['%j', 42]), '42');

assert.equal(format(['%d', undefined]), '%d');
assert.equal(format(['%s', undefined]), 'undefined');
assert.equal(format(['%j', undefined]), '%j');


assert.equal(format(['%d', null]), '%d');
assert.equal(format(['%s', null]), 'null');
assert.equal(format(['%j', null]), 'null');


// assert.equal(format(['%d', '42.0']), '42');
// assert.equal(format(['%d', '42']), '42');
// assert.equal(format(['%s', '42']), '42');
// assert.equal(format(['%j', '42']), '"42"');

// assert.equal(format(['%%s%s', 'foo']), '%sfoo');

// assert.equal(format(['%s']), '%s');
// assert.equal(format(['%s', undefined]), 'undefined');
// assert.equal(format(['%s', 'foo']), 'foo');
// assert.equal(format(['%s:%s']), '%s:%s');
// assert.equal(format(['%s:%s', undefined]), 'undefined:%s');
// assert.equal(format(['%s:%s', 'foo']), 'foo:%s');
// assert.equal(format(['%s:%s', 'foo', 'bar']), 'foo:bar');
// assert.equal(format(['%s:%s', 'foo', 'bar', 'baz']), 'foo:bar baz');
// // assert.equal(format(['%%%s%%', 'hi']), '%hi%');
// // assert.equal(format(['%%%s%%%%', 'hi']), '%hi%%');

// (function() {
//   var o = {};
//   o.o = o;
//   assert.equal(format(['%j', o]), '[Circular]');
// })();
@@ -1739,24 +1739,161 @@
 %5D), 'foo');%0A
+assert.equal(format(%5B'%25s', '%5C%22quoted%5C%22'%5D), '%5C%22quoted%5C%22');%0Aassert.equal(format(%5B'%25j', %7B s: '%5C%22quoted%5C%22' %7D%5D), '%7B%5C%22s%5C%22:%5C%22%5C%5C%22quoted%5C%5C%22%5C%22%7D');%0A
 // assert.eq

add tests for unescaped strings