diff --git a/tests/tokenizer/integration.mwtest b/tests/tokenizer/integration.mwtest index c16fe53..ef6d5c5 100644 --- a/tests/tokenizer/integration.mwtest +++ b/tests/tokenizer/integration.mwtest @@ -192,3 +192,38 @@ name: nodes_inside_external_link_after_punct label: various complex nodes inside an external link following punctuation input: "http://example.com/foo.{{bar}}baz.&biz;bingo" output: [ExternalLinkOpen(brackets=False), Text(text="http://example.com/foo."), TemplateOpen(), Text(text="bar"), TemplateClose(), Text(text="baz.&biz;"), CommentStart(), Text(text="hello"), CommentEnd(), Text(text="bingo"), ExternalLinkClose()] + +--- + +name: newline_and_comment_in_template_name +label: a template name containing a newline followed by a comment +input: "{{foobar\n}}" +output: [TemplateOpen(), Text(text="foobar\n"), CommentStart(), Text(text=" comment "), CommentEnd(), TemplateClose()] + +--- + +name: newline_and_comment_in_template_name_2 +label: a template name containing a newline followed by a comment +input: "{{foobar\n|key=value}}" +output: [TemplateOpen(), Text(text="foobar\n"), CommentStart(), Text(text=" comment "), CommentEnd(), TemplateParamSeparator(), Text(text="key"), TemplateParamEquals(), Text(text="value"), TemplateClose()] + +--- + +name: newline_and_comment_in_template_name_3 +label: a template name containing a newline followed by a comment +input: "{{foobar\n\n|key=value}}" +output: [TemplateOpen(), Text(text="foobar\n"), CommentStart(), Text(text=" comment "), CommentEnd(), Text(text="\n"), TemplateParamSeparator(), Text(text="key"), TemplateParamEquals(), Text(text="value"), TemplateClose()] + +--- + +name: newline_and_comment_in_template_name_4 +label: a template name containing a newline followed by a comment +input: "{{foobar\ninvalid|key=value}}" +output: [Text(text="{{foobar\n"), CommentStart(), Text(text=" comment "), CommentEnd(), Text(text="invalid|key=value}}")] + +--- + +name: newline_and_comment_in_template_name_5 +label: a template name containing a newline followed by a comment +input: "{{foobar\n\ninvalid|key=value}}" +output: [Text(text="{{foobar\n"), CommentStart(), Text(text=" comment "), CommentEnd(), Text(text="\ninvalid|key=value}}")] diff --git a/tests/tokenizer/templates.mwtest b/tests/tokenizer/templates.mwtest index ff8a308..25e178a 100644 --- a/tests/tokenizer/templates.mwtest +++ b/tests/tokenizer/templates.mwtest @@ -384,9 +384,9 @@ output: [TemplateOpen(), Text(text="foo\n "), TemplateClose()] --- name: newlines_spaces_param -label: newlines in the middle of a template name, followed by spaces -input: "{{foo\n }}" -output: [TemplateOpen(), Text(text="foo\n "), TemplateClose()] +label: newlines in the middle of a template name, followed by spaces, with a parameter +input: "{{foo\n |bar=baz}}" +output: [TemplateOpen(), Text(text="foo\n "), TemplateParamSeparator(), Text(text="bar"), TemplateParamEquals(), Text(text="baz"), TemplateClose()] ---