diff options
author | Lars Wirzenius <liw@liw.fi> | 2013-06-09 11:33:12 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2013-06-09 11:33:12 +0100 |
commit | c051b8c7616b2532ca0a1e7d7f6ff28684e2a2aa (patch) | |
tree | 9ce5d2bf440fbdce4bb863e9d2c66ac45addd98a /yarnlib/mdparser_tests.py | |
parent | 63fac3e9f7913865de440e7c02804ddbc2d460a5 (diff) | |
download | cmdtest-c051b8c7616b2532ca0a1e7d7f6ff28684e2a2aa.tar.gz |
Add more tests
Diffstat (limited to 'yarnlib/mdparser_tests.py')
-rw-r--r-- | yarnlib/mdparser_tests.py | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/yarnlib/mdparser_tests.py b/yarnlib/mdparser_tests.py index ad59f50..af0c7af 100644 --- a/yarnlib/mdparser_tests.py +++ b/yarnlib/mdparser_tests.py @@ -36,3 +36,49 @@ More text. ''') self.assertEqual(self.parser.blocks, ['this is a code block\n']) + def test_finds_consecutive_code_blocks_as_one(self): + self.parser.parse_string(''' +This is blah blah text. + + this is a code block + + this is a second code block + +More text. +''') + self.assertEqual( + self.parser.blocks, + ['this is a code block\n\nthis is a second code block\n']) + + def test_finds_code_blocks_with_text_in_between_as_two_blocks(self): + self.parser.parse_string(''' +This is blah blah text. + + this is a code block + +Blah. + + this is a second code block + +More text. +''') + self.assertEqual( + self.parser.blocks, + ['this is a code block\n', 'this is a second code block\n']) + + def test_only_finds_top_level_code_blocks(self): + self.parser.parse_string(''' +This is blah blah text. + + this is a code block + +And now a list: + +* list item + + this is a second level code block + +More text. +''') + self.assertEqual(self.parser.blocks, ['this is a code block\n']) + |