diff options
| author | Bruno Herfst <hello@brunoherfst.com> | 2016-10-26 11:04:09 +1100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-12-10 23:07:48 +0000 |
| commit | bc8c341b37bfac34bbeaccdd5368c2d7edc309ac (patch) | |
| tree | 5c18d634763f5f6ae0defeb07368f0ae28d8ef4d /tests/styles/parser/document_matcher_parser_tests.py | |
| parent | 8661cad2a82b66254fff564f4a514cbd67ad371d (diff) | |
Add support for page and column breaks
Diffstat (limited to 'tests/styles/parser/document_matcher_parser_tests.py')
| -rw-r--r-- | tests/styles/parser/document_matcher_parser_tests.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/styles/parser/document_matcher_parser_tests.py b/tests/styles/parser/document_matcher_parser_tests.py index 194d6fa..0286e7b 100644 --- a/tests/styles/parser/document_matcher_parser_tests.py +++ b/tests/styles/parser/document_matcher_parser_tests.py @@ -132,6 +132,33 @@ def reads_comment_reference(): read_document_matcher("comment-reference") ) +@istest +def reads_line_breaks(): + assert_equal( + document_matchers.line_break, + read_document_matcher("br[type='line']"), + ) + +@istest +def reads_page_breaks(): + assert_equal( + document_matchers.page_break, + read_document_matcher("br[type='page']"), + ) + +@istest +def reads_column_breaks(): + assert_equal( + document_matchers.column_break, + read_document_matcher("br[type='column']"), + ) + + +@istest +def unrecognised_break_type_raises_error(): + error = assert_raises(LineParseError, lambda: read_document_matcher("br[type='unknownBreakType']")) + assert_equal("Unrecognised break type: unknownBreakType", str(error)) + def read_document_matcher(string): return parse_document_matcher(TokenIterator(tokenise(string))) |
