-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
46 lines (40 loc) · 2.05 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
41
42
43
44
45
46
import isAlpha from './index';
import test from 'ava';
[
{ value: `Dude bro....`, expected: true },
{ value: `Hello 1 am an a1phanum3ric string`, expected: true },
{ value: `Hello dude I am also a string with punctuations, and stuff`, expected: true },
{ value: `\t#include<iostream.h>\n\tint main()\n\t{\n\t\treturn (0);\n\t}`, expected: true },
{ value: `Hello @bogas04, some #LSBD shit going on.`, expected: true },
{ value: ``, expected: false }
].map(Case => test(Case.value, t => t.is(isAlpha(Case.value, 'devCode'), Case.expected)) );
[
{ value: `Dude bro....`, expected: false },
{ value: `STRING`, expected: true },
{ value: `Hello dude I am also a string with punctuations; & stuff`, expected: false },
{ value: ``, expected: false }
].map(Case => test(Case.value, t => t.is(isAlpha(Case.value, 'upAlpha'), Case.expected)) );
[
{ value: `dudebro`, expected: true },
{ value: `Hello 1 am an a1phanum3ric string`, expected: false },
{ value: `Hello dude I am also a string with punctuations; & stuff`, expected: false },
{ value: ``, expected: false }
].map(Case => test(Case.value, t => t.is(isAlpha(Case.value, 'lowAlpha'), Case.expected)) );
[
{ value: `32486359`, expected: true },
{ value: `Hello 1 am an a1phanum3ric string`, expected: false },
{ value: `Hello 007`, expected: false },
{ value: ``, expected: false }
].map(Case => test(Case.value, t => t.is(isAlpha(Case.value, 'digits'), Case.expected)) );
[
{ value: `Dudebro`, expected: true },
{ value: `Hello1ama1phanum3ricstring`, expected: true },
{ value: `Hello dude I am also a string with punctuations; & stuff`, expected: false },
{ value: ``, expected: false }
].map(Case => test(Case.value, t => t.is(isAlpha(Case.value, 'alphaNum'), Case.expected)) );
[
{ value: `Dude bro....`, expected: true },
{ value: `Hello 1 am an a1phanum3ric string`, expected: false },
{ value: `Hello dude I am also a string with punctuations; & stuff`, expected: true },
{ value: ``, expected: false }
].map(Case => test(Case.value, t => t.is(isAlpha(Case.value), Case.expected)) );