aboutsummaryrefslogtreecommitdiff
path: root/tests/styles/parser
diff options
context:
space:
mode:
authorBruno Herfst <hello@brunoherfst.com>2016-10-26 11:04:09 +1100
committerMichael Williamson <mike@zwobble.org>2016-12-10 23:07:48 +0000
commitbc8c341b37bfac34bbeaccdd5368c2d7edc309ac (patch)
tree5c18d634763f5f6ae0defeb07368f0ae28d8ef4d /tests/styles/parser
parent8661cad2a82b66254fff564f4a514cbd67ad371d (diff)
Add support for page and column breaks
Diffstat (limited to 'tests/styles/parser')
-rw-r--r--tests/styles/parser/document_matcher_parser_tests.py27
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)))