JetBrains / markdown

Markdown parser written in kotlin
Apache License 2.0
682 stars 75 forks source link

Enable all generated spec tests which currently pass #65

Closed ajalt closed 3 years ago

ajalt commented 3 years ago

Rather than ignoring the entire generated spec test files, I added @Ignore annotations to each individual test case that's currently failing. This allows us to run the test cases that pass.

ajalt commented 3 years ago

For posterity, I used the following script to generate the individual annotations:

# Run all tests in a spec test file from the command line, and pipe stdout to a file.
# Pass that file as argv[1], and the spec test file as argv[2]

import re
import sys

with open(sys.argv[1], encoding='utf8') as f:
    test_output = f.read()

with open(sys.argv[2], encoding='utf8') as f:
    tests = f.read()

for m in re.findall(r'test\w+', test_output):
    tests = tests.replace(r'    fun ' + m, '    @Ignore\n    fun ' + m)

with open(sys.argv[2], 'w', encoding='utf8') as f:
    f.write(tests)
valich commented 3 years ago

That's awesome, thanks! How do you get the contents of the first file though (for posterity :) )?

ajalt commented 3 years ago

I remove the all the @Ignores from one of the spec test files, then run gradle jvmTest > output.txt