forked from frontend-park-mail-ru/sample-2016
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
29 lines (25 loc) · 1.43 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
let assert = require('assert');
let hello = require('./public/main').hello;
let plural = require('./public/main').plural;
let filter = require('./public/main').filter;
//assert.equal(hello('Test'), 'Привет, Test');
// assert.equal(plural(0), 'Здравствуй, дух');
// assert.equal(plural(1), 'Рады приветствовать на нашем курсе!');
// assert.equal(plural(2), 'Кликай дальше!! Еще осталось 13 раз(а)');
// assert.equal(plural(13), 'Кликай дальше!! Еще осталось 2 раз(а)');
// assert.equal(plural(15), '01001000 01101001 00101100 00100000 01100010 01110010 01101111');
// assert.equal(plural(100), '01001000 01101001 00101100 00100000 01100010 01110010 01101111');
global.window = {
rules:['orange', 'apple']
}
assert.equal(filter('orange'), '******');
assert.equal(filter('orange sadfsdaf'), '****** sadfsdaf');
assert.equal(filter(' orange sadfsdaf'), ' ****** sadfsdaf');
assert.equal(filter('sadfsdaf orange'), 'sadfsdaf ******');
assert.equal(filter('orangesadfsdaf'), 'orangesadfsdaf');
assert.equal(filter('asdorangesadfsdaf'), 'asdorangesadfsdaf');
assert.equal(filter('sadfsdaf orange '), 'sadfsdaf ****** ');
assert.equal(filter('asdasd orange asdasd orange asdasd'), 'asdasd ****** asdasd ****** asdasd')
assert.equal(filter('apple'), '*****');
assert.equal(filter('урод'), '****');
assert.equal(filter('sAdfsdAQf OrAngE'), 'sAdfsdAQf ******');