mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
Properly negate with Interpreter, fixes #1636
This commit is contained in:
@@ -704,3 +704,11 @@ def test_variable_reuse():
|
||||
x = 1
|
||||
d, = jedi.Interpreter('y = x\ny', [locals()]).infer()
|
||||
assert d.name == 'int'
|
||||
|
||||
|
||||
def test_negate():
|
||||
code = "x = -y"
|
||||
x, = jedi.Interpreter(code, [{'y': 3}]).infer(1, 0)
|
||||
assert x.name == 'int'
|
||||
value, = x._name.infer()
|
||||
assert value.get_safe_value() == -3
|
||||
|
||||
Reference in New Issue
Block a user