-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.js
64 lines (57 loc) · 1.32 KB
/
tests.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
/**
* @author Gilles Coomans <[email protected]>
* TODO : write real tests.
*/
if (typeof define !== 'function') {
var define = require('amdefine')(module);
}
define(["require", "./index"], function(require, kroked){
var string = [
'# hello',
'',
'@.small hello world',
'',
' @.small(" hello world ")',
'',
'<small> hello </small>',
'<small>`hello`</small>',
'',
'{% section inner ',
' {% reu',
' # hihi',
'',
' <p> <small> hello {{ title }} </small>@.capitilize(doo) `hello`</p>',
'',
' %}',
'%}',
'',
' @.hello(____fast is not enough____ )',
'',
'{% block_inline(fzejkfezl) context(name) %}',
'{! raw_inline(raw_inline) !}',
'',
' {! rawWithTab(raw) capitilize',
' raw text',
' # hjhjd',
' !}',
'',
'__this is bold__',
'',
'{{ name }}',
'{% dp-try(json::/...) %}',
''
].join('\n');
string = string + "\n" + string + "\n" + string;
kroked.perf = function(){
var template, r;
console.time("t");
// for(var i = 0; i < 100; ++i)
template = marked.compile(string, marked.opt);
console.timeEnd("t");
console.time("t2");
// for(var i = 0; i < 100; ++i)
r = template({ name:"john", title:"hello macros"});
console.timeEnd("t2");
//console.log(r);
};
});