示例#1
0
def test_unary_with_combined_signs():
    expr = '-+-+-+-+-78.92'
    parser = ExpressionParser(expr)
    assert parser.unary() == -78.92
示例#2
0
def test_unary_with_multiple_plus_signs():
    expr = '+++++++++++17.31230'
    parser = ExpressionParser(expr)
    assert parser.unary() == 17.3123
示例#3
0
def test_unary_triple_negation():
    expr = '---20'
    parser = ExpressionParser(expr)
    assert parser.unary() == -20
示例#4
0
def test_unary_with_plus_sign():
    expr = '+09.23'
    parser = ExpressionParser(expr)
    assert parser.unary() == 9.23
示例#5
0
def test_unary_double_negation():
    expr = '--19.60'
    parser = ExpressionParser(expr)
    assert parser.unary() == 19.60