diff options
author | Waylan Limberg <waylan@gmail.com> | 2012-12-14 12:09:11 -0500 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2012-12-14 12:09:11 -0500 |
commit | a974fd6e902ccc9e5b782707344d9af734b169b6 (patch) | |
tree | 577ed184089c4320227be081e1e9e15137606d31 /tests | |
parent | f52d62656705841316d1d653644d874b4db9ff37 (diff) | |
download | markdown-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')
-rw-r--r-- | tests/__init__.py | 5 |
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'): |