-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
40 lines (31 loc) · 1.28 KB
/
test.js
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
const assert = require('assert');
const { supportsTls } = require('./ipv7');
const { supportsSsl } = require('./ipv72');
describe('Day 7: Internet Protocol Version 7', () => {
it('should determine if `abba[mnop]qrst` supports TLS', () => {
assert.strictEqual(supportsTls('abba[mnop]qrst'), true);
});
it('should determine if `abcd[bddb]xyyx` supports TLS', () => {
assert.strictEqual(supportsTls('abcd[bddb]xyyx'), false);
});
it('should determine if `aaaa[qwer]tyui` supports TLS', () => {
assert.strictEqual(supportsTls('aaaa[qwer]tyui'), false);
});
it('should determine if `ioxxoj[asdfgh]zxcvbn` supports TLS', () => {
assert.strictEqual(supportsTls('ioxxoj[asdfgh]zxcvbn'), true);
});
describe('Part Two', () => {
it('should determine if `aba[bab]xyz` supports SSL', () => {
assert.strictEqual(supportsSsl('aba[bab]xyz'), true);
});
it('should determine if `xyx[xyx]xyx` supports SSL', () => {
assert.strictEqual(supportsSsl('xyx[xyx]xyx'), false);
});
it('should determine if `aaa[kek]eke` supports SSL', () => {
assert.strictEqual(supportsSsl('aaa[kek]eke'), true);
});
it('should determine if `zazbz[bzb]cdb` supports SSL', () => {
assert.strictEqual(supportsSsl('zazbz[bzb]cdb'), true);
});
});
});