From 87ee9d144b4c1a87a4e98de5c9c67bfb46817e7c Mon Sep 17 00:00:00 2001 From: Brad Solomon Date: Tue, 28 Apr 2020 13:48:35 -0400 Subject: [PATCH] Create test cases for GH Issue #171. Pound-signs followed by a lone CRLF should not raise if require-starting-space is specified. --- tests/rules/test_comments.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/rules/test_comments.py b/tests/rules/test_comments.py index ad18a0e..2c3f399 100644 --- a/tests/rules/test_comments.py +++ b/tests/rules/test_comments.py @@ -186,6 +186,27 @@ class CommentsTestCase(RuleTestCase): 'inline: comment #\n' 'foo: bar\n', conf) + def test_empty_comment_crlf_dos_newlines(self): + conf = ('comments:\n' + ' require-starting-space: true\n' + ' min-spaces-from-content: 2\n' + 'new-lines:\n' + ' type: dos\n') + self.check('---\r\n' + '# This is paragraph 1.\r\n' + '#\r\n' + '# This is paragraph 2.\r\n', conf) + + def test_empty_comment_crlf_disabled_newlines(self): + conf = ('comments:\n' + ' require-starting-space: true\n' + ' min-spaces-from-content: 2\n' + 'new-lines: disable\n') + self.check('---\r\n' + '# This is paragraph 1.\r\n' + '#\r\n' + '# This is paragraph 2.\r\n', conf) + def test_first_line(self): conf = ('comments:\n' ' require-starting-space: true\n'