| 1 | This file generates tests for markdown-it rust library. It gets one argument |
| 2 | (file name) and edits that file in-place, replacing special markers inside |
| 3 | with tests generated from fixtures. |
| 4 | |
| 5 | Run it like this from tests/ folder: |
| 6 | ```sh |
| 7 | for I in *.rs ; do deno run --allow-read --allow-write ./fixtures/testgen.js $I ; done |
| 8 | ``` |
| 9 | |
| 10 | As an example, it replaces this: |
| 11 | ```rs |
| 12 | /////////////////////////////////////////////////////////////////////////// |
| 13 | // TESTGEN: fixtures/commonmark/spec.txt |
| 14 | ... any content here ... |
| 15 | /////////////////////////////////////////////////////////////////////////// |
| 16 | ``` |
| 17 | |
| 18 | With approximately this: |
| 19 | ```rs |
| 20 | /////////////////////////////////////////////////////////////////////////// |
| 21 | // TESTGEN: fixtures/commonmark/spec.txt |
| 22 | #[test] |
| 23 | fn line_123() { |
| 24 | run("*foo*", "<em>foo</em>"); |
| 25 | } |
| 26 | ... more tests here ... |
| 27 | /////////////////////////////////////////////////////////////////////////// |
| 28 | ``` |