import assert from 'assert'
import join from '../lib/join'

describe('join', () => {
  it('joins base path and tokens', () => {
    assert.strictEqual(join('/foo', ['bar', 'foo']), '/foo/bar/foo');
    assert.strictEqual(join('/foo', ['bar']), '/foo/bar');
    assert.strictEqual(join(['foo'], ['bar']), '/foo/bar');
    assert.strictEqual(join(['foo'], 'bar'), '/foo/bar');
    assert.strictEqual(join('/foo', 'bar'), '/foo/bar');
    assert.strictEqual(join('/foo', ['bar']), '/foo/bar');
    assert.strictEqual(join('/foo', []), '/foo');
    assert.strictEqual(join('', ['foo']), '/foo');

    assert.strictEqual(join('', ['0']), '/0');
    assert.strictEqual(join('/0', ['foo']), '/0/foo');
  })
})

@@ -687,16 +687,187 @@
 0/foo');
+%0A%0A    assert.strictEqual(join(%5B%5D, %5B%5D), '');%0A    assert.strictEqual(join('', %5B%5D), '');%0A    assert.strictEqual(join('', ''), '/');%0A    assert.strictEqual(join(%5B%5D, ''), '/');
 %0A  %7D)%0A%7D)

add more join tests