示例#1
0
def test_shift():
    u = 'foo @ 50'
    assert tex(u) == r'{foo} @ {50}'
示例#2
0
def test_complex():
    u = 'microW^2 / (5^-2)π per sec @ 42'
    expected = r'{\frac{{\frac{{{\mu}W}^{2}}{{5}^{-2}}}\cdot{π}}{sec}} @ {42}'
    assert tex(u) == expected
示例#3
0
def test_multiply():
    u = 'foo bar'
    assert tex(u) == r'{foo}\cdot{bar}'
示例#4
0
def test_divide():
    u = 'foo per bar'
    assert tex(u) == r'\frac{foo}{bar}'
示例#5
0
def test_identifier_micro():
    u = 'microW m-2'
    assert tex(u) == r'{{\mu}W}\cdot{{m}^{-2}}'
示例#6
0
def test_raise():
    u = 'm^2'
    assert tex(u) == r'{m}^{2}'
示例#7
0
def test_basic():
    u = "kg kg-1"
    assert tex(u) == r"{kg}\cdot{{kg}^{-1}}"
示例#8
0
def test_basic():
    u = 'kg kg-1'
    assert tex(u) == r'{kg}\cdot{{kg}^{-1}}'
示例#9
0
def test_shift():
    u = "foo @ 50"
    assert tex(u) == r"{foo} @ {50}"
示例#10
0
def test_divide():
    u = "foo per bar"
    assert tex(u) == r"\frac{foo}{bar}"
示例#11
0
def test_multiply():
    u = "foo bar"
    assert tex(u) == r"{foo}\cdot{bar}"
示例#12
0
def test_raise():
    u = "m^2"
    assert tex(u) == r"{m}^{2}"
示例#13
0
def test_identifier_micro():
    u = "microW m-2"
    assert tex(u) == r"{{\mu}W}\cdot{{m}^{-2}}"