From b2ced5bc0413bcf03f6ec2e27552aa276445d0f0 Mon Sep 17 00:00:00 2001 From: Sean Brant Date: Thu, 14 Mar 2013 22:17:56 -0500 Subject: Fixes indenting issues --- tests/fixtures/comments.txt | 11 ++++++++++- tests/test_comment.py | 16 +++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/fixtures/comments.txt b/tests/fixtures/comments.txt index 37dcdf6..885887c 100644 --- a/tests/fixtures/comments.txt +++ b/tests/fixtures/comments.txt @@ -30,4 +30,13 @@ Indented comments: // Indented single-line comment. - /* Indented block comment. */ \ No newline at end of file + /* Indented block comment. */ + + +Comment with example: + +/* This comment has a indented example + *
+ *
+ *
+ */ diff --git a/tests/test_comment.py b/tests/test_comment.py index ea47156..e1e94c6 100644 --- a/tests/test_comment.py +++ b/tests/test_comment.py @@ -19,10 +19,10 @@ class CommentMethodTestCase(unittest.TestCase): self.assertFalse(comment.is_multi_line_comment_end("nooooope")) def test_parses_the_single_line_comment_syntax(self): - self.assertEqual(comment.parse_single_line("// yuuuuup"), 'yuuuuup') + self.assertEqual(comment.parse_single_line("// yuuuuup"), ' yuuuuup') def test_parses_the_multi_line_comment_syntax(self): - self.assertEqual(comment.parse_multi_line('/* yuuuup */'), 'yuuuup') + self.assertEqual(comment.parse_multi_line('/* yuuuup */'), ' yuuuup') class CommentParserTestCase(unittest.TestCase): @@ -35,7 +35,8 @@ class CommentParserTestCase(unittest.TestCase): expected = """ This comment block has comment identifiers on every line. -Fun fact: this is Kyle's favorite comment syntax!""" +Fun fact: this is Kyle's favorite comment syntax! + """ self.assertTrue(expected.strip() in self.comments) def test_finds_block_style_comment_styles(self): @@ -63,3 +64,12 @@ It has stars at the begining of every line. def test_handles_indented_comments(self): self.assertTrue('Indented single-line comment.' in self.comments) self.assertTrue('Indented block comment.' in self.comments) + + def test_handles_indented_example(self): + expected = """ +This comment has a indented example +
+
+
+ """ + self.assertTrue(expected.strip() in self.comments) -- cgit v1.2.3