var bracket = require('./bracket_push');

describe('bracket push', function() {
  it('checks for appropriate bracketing in a set of brackets', function() {
    expect(bracket('{}')).toEqual(true);
  });

  xit('returns false for unclosed brackets', function() {
    expect(bracket('{{')).toEqual(false);
  });

  xit('returns false if brackets are out of order', function() {
    expect(bracket('}{')).toEqual(false);
  });

  xit('checks bracketing in more than one pair of brackets', function() {
    expect(bracket('{}[]')).toEqual(true);
  });

  xit('checks bracketing in nested brackets', function() {
    expect(bracket('{[]}')).toEqual(true);
  });

  xit('checks bracket closure with deeper nesting', function() {
    expect(bracket('{[)][]}')).toEqual(false);
  });

  xit('checks bracket closure in a long string of brackets', function() {
    expect(bracket('{[]([()])}')).toEqual(true);
  });
});

var bracket = require('./bracket_push');

describe('bracket push', function() {
  it('checks for appropriate bracketing in a set of brackets', function() {
    expect(bracket('{}')).toEqual(true);
  });

  xit('returns false for unclosed brackets', function() {
    expect(bracket('{{')).toEqual(false);
  });

  xit('returns false if brackets are out of order', function() {
    expect(bracket('}{')).toEqual(false);
  });

  xit('checks bracketing in more than one pair of brackets', function() {
    expect(bracket('{}[]')).toEqual(true);
  });

  xit('checks bracketing in nested brackets', function() {
    expect(bracket('{[]}')).toEqual(true);
  });

  xit('rejects brackets that are properly balanced but improperly nested', function() {
    expect(bracket('{[}]')).toEqual(false);
  });

  xit('checks bracket closure with deeper nesting', function() {
    expect(bracket('{[)][]}')).toEqual(false);
  });

  xit('checks bracket closure in a long string of brackets', function() {
    expect(bracket('{[]([()])}')).toEqual(true);
  });
});

Add test for proper nesting
bracket-push: Add test for proper nesting

This rules out solutions that simply count the number of open/close
brackets without regard for whether they are properly nested.

I submitted a solution (in another language track) that would have
failed this test and did not realize it until looking at others'
solutions. It would be great if I could have known before submitting,
thus I add this test.
