[given]
md = '''
### Preamble A
Starts with H3.
## Preamble B
Starts with H2.
# Alpha
My first section.
## Sub-section
Hello, world.
# Bravo
My second section.
'''
[expect."select top-level section"]
cli_args = ["# alpha"]
output = '''
# Alpha
My first section.
## Sub-section
Hello, world.
'''
[expect."select subsection"]
cli_args = ["# sub"]
output = '''
## Sub-section
Hello, world.
'''
[expect."select all sections"]
cli_args = ["#"]
output = '''
### Preamble A
Starts with H3.
-----
## Preamble B
Starts with H2.
-----
# Alpha
My first section.
## Sub-section
Hello, world.
-----
# Bravo
My second section.
'''
[expect."chained"]
cli_args = ['# bravo | # bravo']
output = '''
# Bravo
My second section.
'''
[expect."section minimum level"]
cli_args = ['#{2,}']
output = '''
### Preamble A
Starts with H3.
-----
## Preamble B
Starts with H2.
-----
## Sub-section
Hello, world.
'''
[expect."section maximum level"]
cli_args = ['#{,2}']
output = '''
## Preamble B
Starts with H2.
-----
# Alpha
My first section.
## Sub-section
Hello, world.
-----
# Bravo
My second section.
'''
[expect."section exact level"]
cli_args = ['#{2}']
output = '''
## Preamble B
Starts with H2.
-----
## Sub-section
Hello, world.
'''