cmark

My personal build of CMark ✏️

Commit
6e8c3f6148ec586fd4cc5c89c644422dd6ec33d5
Parent
df5eed3b7fce2853e331c7de5294668c5b376334
Author
John MacFarlane <jgm@berkeley.edu>
Date

Merge pull request #120 from nwellnhof/regression-tests

Add first regression tests

Diffstat

3 files changed, 42 insertions, 1 deletion

Status File Name N° Changes Insertions Deletions
Modified test/CMakeLists.txt 7 7 0
Added test/regression.txt 34 34 0
Modified test/spec_tests.py 2 1 1
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
@@ -53,6 +53,13 @@ IF (PYTHONINTERP_FOUND)
     "${ROUNDTRIP} ${CMAKE_CURRENT_BINARY_DIR}/../src/cmark"
     )
 
+  add_test(regressiontest_executable
+    ${PYTHON_EXECUTABLE}
+    "${CMAKE_CURRENT_SOURCE_DIR}/spec_tests.py" "--no-normalize" "--spec"
+    "${CMAKE_CURRENT_SOURCE_DIR}/regression.txt" "--program"
+    "${CMAKE_CURRENT_BINARY_DIR}/../src/cmark"
+    )
+
 
 ELSE(PYTHONINTERP_FOUND)
 
diff --git a/test/regression.txt b/test/regression.txt
@@ -0,0 +1,34 @@
+### Regression tests
+
+Issue #113: EOL character weirdness on Windows
+(Important: first line ends with CR + CR + LF)
+
+```````````````````````````````` example
+line1

+line2
+.
+<p>line1</p>
+<p>line2</p>
+````````````````````````````````
+
+Issue #114: cmark skipping first character in line
+(Important: the blank lines around "Repeatedly" contain a tab.)
+
+```````````````````````````````` example
+By taking it apart
+
+- alternative solutions
+→
+Repeatedly solving
+→
+- how techniques
+.
+<p>By taking it apart</p>
+<ul>
+<li>alternative solutions</li>
+</ul>
+<p>Repeatedly solving</p>
+<ul>
+<li>how techniques</li>
+</ul>
+````````````````````````````````
diff --git a/test/spec_tests.py b/test/spec_tests.py
@@ -87,7 +87,7 @@ def get_tests(specfile):
 
     header_re = re.compile('#+ ')
 
-    with open(specfile, 'r', encoding='utf-8') as specf:
+    with open(specfile, 'r', encoding='utf-8', newline='\n') as specf:
         for line in specf:
             line_number = line_number + 1
             l = line.strip()