aboutsummaryrefslogtreecommitdiffstats
path: root/tests/__init__.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2012-12-14 12:09:11 -0500
committerWaylan Limberg <waylan@gmail.com>2012-12-14 12:09:11 -0500
commita974fd6e902ccc9e5b782707344d9af734b169b6 (patch)
tree577ed184089c4320227be081e1e9e15137606d31 /tests/__init__.py
parentf52d62656705841316d1d653644d874b4db9ff37 (diff)
downloadmarkdown-a974fd6e902ccc9e5b782707344d9af734b169b6.tar.gz
markdown-a974fd6e902ccc9e5b782707344d9af734b169b6.tar.bz2
markdown-a974fd6e902ccc9e5b782707344d9af734b169b6.zip
Normalize line endings in tests as git may alter them on Windows.
Without this, all SyntaxTests would fail from a git checkout on Windows. On other systems, it should have no effect.
Diffstat (limited to 'tests/__init__.py')
-rw-r--r--tests/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
index c790b09..4722e33 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -90,10 +90,11 @@ class CheckSyntax(object):
input = f.read()
output_file = file + config.get(cfg_section, 'output_ext')
with codecs.open(output_file, encoding="utf-8") as f:
- expected_output = f.read()
+ # Normalize line endings (on windows, git may have altered line endings).
+ expected_output = f.read().replace("\r\n", "\n")
output = markdown.markdown(input, **get_args(file, config))
if tidy and config.get(cfg_section, 'normalize'):
- # Normalize whitespace before comparing.
+ # Normalize whitespace with Tidy before comparing.
expected_output = normalize(expected_output)
output = normalize(output)
elif config.get(cfg_section, 'normalize'):