-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.js
67 lines (52 loc) · 1.45 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//////////////////
// sample tests //
//////////////////
/**
run:
node test.js
*/
var lme = require('./index');
function testAllLogFunctions() {
var args = Array.prototype.slice.call(arguments);
lme.d.apply(lme, args);
lme.s.apply(lme, args);
lme.w.apply(lme, args);
lme.e.apply(lme, args);
lme.h.apply(lme, args);
lme.i.apply(lme, args);
lme.t.apply(lme, args);
lme.d('\n');
}
function testAllLineFunctions() {
var args = Array.prototype.slice.call(arguments);
lme.line.apply(lme, args);
lme.dline.apply(lme, args);
lme.sline.apply(lme, args);
lme.wline.apply(lme, args);
lme.eline.apply(lme, args);
lme.hline.apply(lme, args);
lme.iline.apply(lme, args);
lme.tline.apply(lme, args);
}
// objects
testAllLogFunctions({ kity: 'is pinky', fluffy: 'is funny!' });
// strings
testAllLogFunctions('mango is sweet!');
//Multiple Params
testAllLogFunctions('mango is sweet!', { mango: 'sweet' });
testAllLogFunctions('mango is sweet!', '!!!');
testAllLogFunctions({ 'mango is': 'sweet' }, { 'mango is': 'sweet' });
// lines
testAllLineFunctions();
testAllLineFunctions('*', 10);
testAllLineFunctions('*', 110);
// error-ed outputs for lines
lme.i('\nerror-ed outputs');
testAllLineFunctions({ yu: 1 });
var e = new Error('oh noo!');
testAllLogFunctions(e, '!!!');
testAllLogFunctions(e);
lme.wline();
lme.e(e);
console.log(e); // not getting this kind of err above..
lme.i('test finished');