|
1 |
| -describe('corresponding_bracket_index_test', function() { |
2 |
| - describe('valid_source_code', function() { |
3 |
| - it('should return 6 when the caret index is 0', function() { |
| 1 | +describe('corresponding_bracket_index_test', () => { |
| 2 | + describe('valid_source_code', () => { |
| 3 | + it('should return 6 when the caret index is 0', () => { |
4 | 4 | chai.assert.equal(corresponding_bracket_index(valid_source_code, 0), 6);
|
5 | 5 | });
|
6 | 6 |
|
7 |
| - it('should return 0 when the caret index is 6', function() { |
| 7 | + it('should return 0 when the caret index is 6', () => { |
8 | 8 | chai.assert.equal(corresponding_bracket_index(valid_source_code, 6), 0);
|
9 | 9 | });
|
10 | 10 |
|
11 |
| - it('should return 26 when the caret index is 9', function() { |
| 11 | + it('should return 26 when the caret index is 9', () => { |
12 | 12 | chai.assert.equal(corresponding_bracket_index(valid_source_code, 9), 26);
|
13 | 13 | });
|
14 | 14 |
|
15 |
| - it('should return 8 when the caret index is 27', function() { |
| 15 | + it('should return 8 when the caret index is 27', () => { |
16 | 16 | chai.assert.equal(corresponding_bracket_index(valid_source_code, 27), 8);
|
17 | 17 | });
|
18 | 18 | });
|
19 | 19 |
|
20 | 20 | describe('invalid_source_code', () => {
|
21 |
| - it('should throw "invalid brackets in source code" on improper nesting', function() { |
| 21 | + it('should throw "invalid brackets in source code" on improper nesting', () => { |
22 | 22 | chai.assert.throws(() => { corresponding_bracket_index(improper_nesting, 2) }, Error, 'Invalid brackets in source code.');
|
23 | 23 | });
|
24 | 24 |
|
25 |
| - it('should throw "invalid brackets in source code" on incorrect closing bracket', function() { |
| 25 | + it('should throw "invalid brackets in source code" on incorrect closing bracket', () => { |
26 | 26 | chai.assert.throws(() => { corresponding_bracket_index(wrong_closing_bracket, 2) }, Error, 'Invalid brackets in source code.');
|
27 | 27 | });
|
28 | 28 |
|
29 |
| - it('should throw "Unclosed brackets in source code" on unclosed bracket', function() { |
| 29 | + it('should throw "Unclosed brackets in source code" on unclosed bracket', () => { |
30 | 30 | chai.assert.throws(() => { corresponding_bracket_index(unclosed_bracket, 2) }, Error, 'Unclosed brackets in source code.');
|
31 | 31 | });
|
32 | 32 |
|
33 |
| - it('should throw "Invalid caret index. Caret must point to a bracket" if no braces', function() { |
| 33 | + it('should throw "Invalid caret index. Caret must point to a bracket" if no braces', () => { |
34 | 34 | chai.assert.throws(() => { corresponding_bracket_index(no_braces, 2) }, Error, 'Invalid caret index. Caret must point to a bracket.');
|
35 | 35 | });
|
36 | 36 |
|
37 |
| - it('should throw "Invalid caret index. Caret must point to a bracket" on invalid caret index', function() { |
| 37 | + it('should throw "Invalid caret index. Caret must point to a bracket" on invalid caret index', () => { |
38 | 38 | chai.assert.throws(() => { corresponding_bracket_index(valid_source_code, 2) }, Error, 'Invalid caret index. Caret must point to a bracket.');
|
39 | 39 | });
|
40 | 40 | });
|
|
0 commit comments