forked from loiane/javascript-datastructures-algorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbalanced-symbols.spec.ts
42 lines (32 loc) · 1.01 KB
/
balanced-symbols.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import 'mocha';
import { expect } from 'chai';
import { parenthesesChecker } from '../../../src/ts/others/balanced-symbols';
describe('Balanced Symbols', () => {
it('empty to be falsy', () => {
expect(parenthesesChecker('')).to.equal(true);
});
it('{ to be falsy', () => {
expect(parenthesesChecker('{')).to.equal(false);
});
it('} to be falsy', () => {
expect(parenthesesChecker('}')).to.equal(false);
});
it('11 to be falsy', () => {
expect(parenthesesChecker('11')).to.equal(false);
});
it('{11 to be falsy', () => {
expect(parenthesesChecker('{11')).to.equal(false);
});
it('{([1])} to be falsy', () => {
expect(parenthesesChecker('{([1])}')).to.equal(false);
});
it('{([])} to be truthy', () => {
expect(parenthesesChecker('{([])}')).to.equal(true);
});
it('{{([][])}()} to be truthy', () => {
expect(parenthesesChecker('{{([][])}()}')).to.equal(true);
});
it('[{()] to be falsy', () => {
expect(parenthesesChecker('[{()]')).to.equal(false);
});
});