Repository navigation
Expand file tree
/
Copy pathhuifier_test.js
More file actions
42 lines (37 loc) · 1.67 KB
/
Copy pathhuifier_test.js
File metadata and controls
42 lines (37 loc) · 1.67 KB
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
describe('Huifier', function () {
var huify = require('./huifier');
it('should huify words', function () {
expect(huify('Вилка')).toEqual('Хуилка');
expect(huify('Толик')).toEqual('Хуелик');
expect(huify('Яблоко')).toEqual('Хуяблоко');
expect(huify('Красный')).toEqual('Хуясный');
expect(huify('Круассан')).toEqual('Хуюассан');
expect(huify('Хрю')).toEqual('Хую');
});
it('should apply rules for vowels', function () {
expect(huify('Арка')).toEqual('Хуярка');
expect(huify('Едут')).toEqual('Хуедут');
expect(huify('Ёжик')).toEqual('Хуёжик');
expect(huify('Иглу')).toEqual('Хуиглу');
expect(huify('Окна')).toEqual('Хуекна');
expect(huify('Урна')).toEqual('Хуюрна');
expect(huify('Стык')).toEqual('Хуик');
expect(huify('Эпос')).toEqual('Хуепос');
expect(huify('Юрта')).toEqual('Хуюрта');
expect(huify('Ящик')).toEqual('Хуящик');
});
it('should handle different letter cases', function () {
expect(huify('Вилка')).toEqual('Хуилка');
expect(huify('вилка')).toEqual('Хуилка');
expect(huify('вилка')).toEqual('Хуилка');
expect(huify('вИлКа')).toEqual('Хуилка');
});
it('should normalize the input', function () {
expect(huify('')).toEqual('Хуй');
expect(huify(' ')).toEqual('Хуй');
expect(huify(' ')).toEqual('Хуй');
expect(huify(' Вилка ')).toEqual('Хуилка');
expect(huify('Й')).toEqual('Хуй');
expect(huify('А')).toEqual('Хуя');
});
});