1 | var markdown = require('Markdown');
|
2 |
|
3 | function clone_array( input ) {
|
4 | eval( "var tmp = " + input.toSource() );
|
5 | return tmp;
|
6 | }
|
7 |
|
8 | tests = {
|
9 | test_arguments_untouched: function() {
|
10 | var input = "A [link][id] by id.\n\n[id]: http://google.com",
|
11 | tree = markdown.parse( input ),
|
12 | clone = clone_array( tree );
|
13 |
|
14 |
|
15 | var output = markdown.toHTML( tree );
|
16 |
|
17 | asserts.same( tree, clone, "tree isn't modified" );
|
18 |
|
19 |
|
20 |
|
21 | asserts.same( markdown.toHTML( tree ), output, "output is consistent" );
|
22 | }
|
23 | }
|
24 |
|
25 | if (require.main === module) {
|
26 | var asserts = require('test').asserts;
|
27 | require('test').runner(tests);
|
28 | }
|