forked from adamschwartz/log
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
72 lines (63 loc) · 2.13 KB
/
test.html
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
68
69
70
71
72
<head>
<title>Log Test Suite</title>
<style>body { font-family: 'Helvetica Neue', sans-serif }</style>
<script src="log.js"></script>
<script>
log('[c="font-family: \'Helvetica Neue\', Helvetica, Arial, sans-serif; color: #fff; font-size: 20px; padding: 15px 20px; background: #444; border-radius: 4px; line-height: 100px; text-shadow: 0 1px #000"]Log Test Suite[c]');
var codeStyle = 'background: rgb(255, 255, 219); padding: 1px 5px; border: 1px solid rgba(0, 0, 0, 0.1)';
var bold = 'font-weight: bold';
var italic = 'font-style: italic';
var testHeaderStyle = 'font-weight: bold; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; color: #444; padding: 8px 0; line-height: 40px';
var testNumber = 1;
var testHeader = function() {
log.l('%cTest ' + (testNumber++), testHeaderStyle);
};
testHeader();
log.l('Expected:');
log.l('%citalic%c and %cbold%c', italic, '', bold, '');
log.l('Result:');
log('*italic* and _bold_');
testHeader();
log.l('Expected:');
log.l('%cbold (with parentheses)%c', bold, '');
log.l('Result:');
log('_bold (with parentheses)_');
testHeader();
log.l('Expected:');
log.l('%citalic (with parentheses)%c', italic, '');
log.l('Result:');
log('*italic (with parentheses)*');
testHeader();
log.l('Expected:');
log.l('%citalic%c and %cbold%c. %cthis is italic%c and %cthis is bold%c.', italic, '', bold, '', italic, '', bold, '');
log.l('Result:');
log('*italic* and _bold_. *this is italic* and _this is bold_.');
testHeader();
log.l('Expected:');
log.l('this is bold link: %chttp://google.com%c', bold, '');
log.l('Result:');
log('this is bold link: _http://google.com_');
testHeader();
log.l('Expected:');
log.l('%ca == b', codeStyle);
log.l('Result:');
log('`a == b`');
testHeader();
log.l('Expected:');
log.l('%ca == (b + c)', codeStyle);
log.l('Result:');
log('`a == (b + c)`');
testHeader();
log.l('Expected:');
log.l('%cred', 'color: red');
log.l('Result:');
log("[c=\"color:red\"]red[c]");
testHeader();
log.l('Expected:');
log.l('%cred %cand %c[blue]', 'color: red', '', 'color: blue');
log.l('Result:');
log("[c=\"color:red\"]red[c] and [c=\'color:blue\'][blue][c]");
</script>
</head>
<body>
Open the console