Ejemplo n.º 1
0
def test_note_with_cloze_number_and_hint():
    assert parse_roam_block('{c0|content|hint}') == [
        Cloze(['content'], 'hint', number=0)
    ]
Ejemplo n.º 2
0
def test_simple_note_with_hint():
    assert parse_roam_block('{content|hint}') == [Cloze(['content'], 'hint')]
Ejemplo n.º 3
0
def test_note_with_cloze_number():
    assert parse_roam_block('{c0|content}') == [Cloze(['content'], number=0)]
Ejemplo n.º 4
0
def test_code_block():
    assert parse_roam_block('```{code}```') == [CodeBlock('{code}')]
Ejemplo n.º 5
0
def test_simple_note_with_newline():
    assert parse_roam_block('{con\ntent}') == [Cloze(['con\ntent'])]
Ejemplo n.º 6
0
def test_parse_math_part():
    assert parse_roam_block(r'$$\textrm{math}$$') == [Math(r'\textrm{math}')]
Ejemplo n.º 7
0
def test_parse_cloze_containing_code_block():
    parts = parse_roam_block('{```co``de```}')
    assert parts == [Cloze([CodeBlock('co``de')])]
Ejemplo n.º 8
0
def test_colon_command_with_curly_brackets():
    assert parse_roam_block(':hiccup {text}') == [
        RoamColonCommand('hiccup', ' {text}')
    ]
Ejemplo n.º 9
0
def test_colon_command_with_space_after():
    text = ': hiccup text'
    assert parse_roam_block(text) == [text]
Ejemplo n.º 10
0
def test_simple_note_with_malformed_double_brackets():
    assert parse_roam_block('{ {content}}') == ['{ {content}}']
Ejemplo n.º 11
0
def test_simple_note_with_single_brackets_inside_double_brackets():
    text = ' query: {and: [[TODO]]} '
    assert parse_roam_block('{{' + text + '}}') == [RoamCurlyCommand(text)]
Ejemplo n.º 12
0
def test_simple_note_with_double_brackets():
    assert parse_roam_block('{{content}}') == [RoamCurlyCommand('content')]
Ejemplo n.º 13
0
def test_parse_cloze():
    assert parse_roam_block('{cloze}') == [Cloze(['cloze'])]
Ejemplo n.º 14
0
def test_parse_string():
    assert parse_roam_block('text') == ['text']
Ejemplo n.º 15
0
def test_note_with_cloze_then_text():
    assert parse_roam_block('{c1|content} text') == [
        Cloze(['content'], number=1), ' text'
    ]
Ejemplo n.º 16
0
def test_colon_command_with_non_whitespace_text_immediately_after():
    assert parse_roam_block(':hiccuptext') == [
        RoamColonCommand('hiccup', 'text')
    ]
Ejemplo n.º 17
0
def test_note_with_text_then_cloze():
    assert parse_roam_block('text{c1|content}') == [
        'text', Cloze(['content'], number=1)
    ]
Ejemplo n.º 18
0
def test_code_inline():
    assert parse_roam_block('`{code}`') == [CodeInline('{code}')]
Ejemplo n.º 19
0
def test_parse_cloze_containing_math():
    parts = parse_roam_block(r'{$$\textrm{math}$$}')
    assert parts == [Cloze([Math(r'\textrm{math}')])]
Ejemplo n.º 20
0
def test_parse_cloze_containing_code_inline():
    parts = parse_roam_block('{`code``code`}')
    assert parts == [Cloze([CodeInline('code'), CodeInline('code')])]