summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/CMakeLists.txt7
-rw-r--r--test/regression.txt34
-rw-r--r--test/spec.txt4
-rwxr-xr-xtest/spec_tests.py2
4 files changed, 44 insertions, 3 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index d537ab5..fbfd1d0 100755
--- 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
new file mode 100644
index 0000000..c8a1057
--- /dev/null
+++ 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.txt b/test/spec.txt
index 0309eaa..1a4a7dc 100644
--- a/test/spec.txt
+++ b/test/spec.txt
@@ -1,8 +1,8 @@
---
title: CommonMark Spec
author: John MacFarlane
-version: 0.24
-date: '2016-01-12'
+version: 0.25
+date: '2016-03-24'
license: '[CC-BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)'
...
diff --git a/test/spec_tests.py b/test/spec_tests.py
index d5b4d05..1521a82 100755
--- 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()