Skip to content

Commit

Permalink
Merge pull request #1002 from UziTech/test-fix
Browse files Browse the repository at this point in the history
All right. LGTM! Easy to change in future without affecting our users...rollback or something else. And confirmed.

Again, awesome work. Thank you.
  • Loading branch information
joshbruce committed Jan 6, 2018
2 parents 54f8f7b + 33b8848 commit ba26457
Show file tree
Hide file tree
Showing 176 changed files with 209 additions and 4,412 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
node_modules/
test/compiled_tests
44 changes: 20 additions & 24 deletions README.md
Expand Up @@ -322,23 +322,19 @@ features][gfmf].

## Benchmarks

node v0.8.x
node v8.9.4

``` bash
$ node test --bench
marked completed in 3411ms.
marked (gfm) completed in 3727ms.
marked (pedantic) completed in 3201ms.
robotskirt completed in 808ms.
showdown (reuse converter) completed in 11954ms.
showdown (new converter) completed in 17774ms.
markdown-js completed in 17191ms.
$ npm run bench
marked completed in 3408ms.
marked (gfm) completed in 3465ms.
marked (pedantic) completed in 3032ms.
showdown (reuse converter) completed in 21444ms.
showdown (new converter) completed in 23058ms.
markdown-it completed in 3364ms.
markdown.js completed in 12090ms.
```

__Marked is now faster than Discount, which is written in C.__

For those feeling skeptical: These benchmarks run the entire markdown test suite 1000 times. The test suite tests every feature. It doesn't cater to specific aspects.

### Pro level

You also have direct access to the lexer and parser if you so desire.
Expand Down Expand Up @@ -373,23 +369,23 @@ suite. If you're adding a new feature, be sure to add your own test.
The marked test suite is set up slightly strangely: `test/new` is for all tests
that are not part of the original markdown.pl test suite (this is where your
test should go if you make one). `test/original` is only for the original
markdown.pl tests. `test/tests` houses both types of tests after they have been
combined and moved/generated by running `node test --fix` or `marked --test
--fix`.
markdown.pl tests.
In other words, if you have a test to add, add it to `test/new/` and then
regenerate the tests with `node test --fix`. Commit the result. If your test
In other words, if you have a test to add, add it to `test/new/`. If your test
uses a certain feature, for example, maybe it assumes GFM is *not* enabled, you
can add `.nogfm` to the filename. So, `my-test.text` becomes
`my-test.nogfm.text`. You can do this with any marked option. Say you want
line breaks and smartypants enabled, your filename should be:
`my-test.breaks.smartypants.text`.
can add [front-matter](https://www.npmjs.com/package/front-matter) to the top of
your `.md` file
``` yml
---
gfm: false
---
```
To run the tests:
``` bash
cd marked/
node test
npm run test
```
### Contribution and License Agreement
Expand Down
2 changes: 1 addition & 1 deletion marked.min.js

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -25,6 +25,8 @@
"devDependencies": {
"markdown": "*",
"showdown": "*",
"markdown-it": "*",
"front-matter": "^2.3.0",
"gulp": "^3.8.11",
"gulp-uglify": "^1.1.0",
"gulp-concat": "^2.5.2"
Expand Down

0 comments on commit ba26457

Please sign in to comment.