Sha256: 2e406986d8a9ae143429b42ab4342e68ff0976c2972de3c3ce97de6886b102f5

Contents?: true

Size: 1.03 KB

Versions: 141

Compression:

Stored size: 1.03 KB

Contents

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);
  });
});

Version data entries

141 entries across 141 versions & 1 rubygems

Version Path
trackler-2.2.1.139 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.138 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.137 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.136 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.135 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.134 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.133 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.132 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.131 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.130 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.129 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.128 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.127 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.126 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.125 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.124 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.123 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.122 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.121 tracks/javascript/exercises/bracket-push/bracket-push.spec.js
trackler-2.2.1.120 tracks/javascript/exercises/bracket-push/bracket-push.spec.js