1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 # Test suites for module `markdown`
18 import markdown_html_rendering
20 # Abstract test class that instanciates the markdown parser
21 abstract class TestMarkdown
23 # Markdown parser to use in tests
24 var md_parser
= new MdParser
26 # Parse a `md` string as a MdNode
27 fun parse_md
(md
: String): MdNode do return md_parser
.parse
(md
)
30 # Abstract test class that defines the test methods for HTML rendering
31 abstract class TestMarkdownHtml
34 # HTML renderer used in tests
35 var html_renderer
= new HtmlRenderer
37 # Render the `md` string as HTML
38 fun md_to_html
(md
: String): String do
39 var node
= parse_md
(md
)
40 return html_renderer
.render
(node
)