예제 #1
0
assert_eq([], entire_doc.forge([]))
assert_eq([nijiconf.BR], entire_doc.forge(['']))

assert_list_eq([
    'A' + nijiconf.BR,
    nijiconf.MONO_BLOCK_BEGIN,
    '$ this' + nijiconf.BOLD_BEGIN + 'mono' + nijiconf.BOLD_END + 'line' + nijiconf.BR,
    'another' + nijiconf.BOLD_BEGIN + 'mono' + nijiconf.BOLD_END + 'line' + nijiconf.BR,
    nijiconf.MONO_BLOCK_END,
    nijiconf.TABLE_BEGIN,
    nijiconf.ROW_BEGIN +
        (nijiconf.CELL_BEGIN % ('', ' table')) +
        nijiconf.CELL_END + (nijiconf.CELL_BEGIN % ('', 'in')) +
        nijiconf.CELL_END + nijiconf.ROW_END,
    nijiconf.ROW_BEGIN +
        (nijiconf.CELL_BEGIN % ((nijiconf.CELL_ROW_SPAN % '2'), 'it')) +
        nijiconf.CELL_END + nijiconf.ROW_END,
    nijiconf.TABLE_END,
], entire_doc.forge([
    'A',
    '{{{',
    '$ this**mono**line',
    'another**mono**line',
    '}}}',
    '[[[',
    '|| table||in',
    '||;r2;it',
    ']]]',
]))

assert_list_eq([
    'A' + nijiconf.BR,
예제 #2
0
파일: test_aa.py 프로젝트: neuront/nijitext
import entire_doc

from test_common import assert_list_eq
import nijiconf

assert_list_eq(
    [
        nijiconf.SPACE + ": iii" + nijiconf.BR,
        ":iii" + nijiconf.BR,
        nijiconf.AA_BEGIN,
        "``not" + nijiconf.SPACE + "code``" + nijiconf.BR,
        "just" + nijiconf.SPACE + "**aa**" + nijiconf.BR,
        nijiconf.AA_END,
        ": not " + nijiconf.BOLD_BEGIN + "aa" + nijiconf.BOLD_END + nijiconf.BR,
    ],
    entire_doc.forge([" : iii", ":iii", ": ``not code``", ": just **aa**", "\\: not **aa**"]),
)

assert_list_eq(
    [nijiconf.AA_BEGIN, nijiconf.BR, "just" + nijiconf.SPACE + "**aa**" + nijiconf.BR, nijiconf.AA_END],
    entire_doc.forge([":", ": just **aa**"]),
)

assert_list_eq(
    [nijiconf.AA_BEGIN, nijiconf.BR, "just" + nijiconf.SPACE + "**aa**" + nijiconf.BR, nijiconf.AA_END],
    entire_doc.forge([": ", ": just **aa**"]),
)

assert_list_eq(
    [
        nijiconf.AA_BEGIN,
예제 #3
0
import entire_doc

from test_common import assert_list_eq
import nijiconf

assert_list_eq([
    nijiconf.SPACE + '{{{' + nijiconf.BR,
    nijiconf.MONO_BLOCK_BEGIN % '',
    nijiconf.BOLD_BEGIN + 'print' + nijiconf.BOLD_END + ' ' + nijiconf.DQUOT +
        'hello, world' + nijiconf.DQUOT + nijiconf.BR,
    nijiconf.MONO_BLOCK_END,
], entire_doc.forge([
    ' {{{',
    '{{{',
    '**print** "hello, world"',
    '}}}',
]))

assert_list_eq([
    nijiconf.MONO_BLOCK_BEGIN % ' lang-python',
    nijiconf.BOLD_BEGIN + 'print' + nijiconf.BOLD_END + ' ' + nijiconf.DQUOT +
        'hello, world' + nijiconf.DQUOT + nijiconf.BR,
    nijiconf.MONO_BLOCK_END,
], entire_doc.forge([
    '{{{ python',
    '**print** "hello, world"',
    '}}}',
]))