예제 #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