summaryrefslogtreecommitdiffstats
path: root/lang/python/python-markdown/test.sh
blob: 3dc856a0e3b4f27a44ec51af13298cc24eaf1591 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

[ "$1" = python3-markdown ] || exit 0

python3 - << 'EOF'

import markdown

# Basic conversion
result = markdown.markdown("# Hello World")
assert result == "<h1>Hello World</h1>", f"got: {result}"

# Bold and italic
result = markdown.markdown("**bold** and *italic*")
assert "<strong>bold</strong>" in result
assert "<em>italic</em>" in result

# List
result = markdown.markdown("- item1\n- item2")
assert "<ul>" in result
assert "<li>item1</li>" in result

EOF