From 3b372e2fe2185869f2b41c39e880d3a7abdd7055 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 9 Mar 2014 12:00:28 +0100 Subject: [PATCH] add some operator tests for precedences (array indexing) --- test/completion/operators.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/completion/operators.py diff --git a/test/completion/operators.py b/test/completion/operators.py new file mode 100644 index 00000000..3389a2f1 --- /dev/null +++ b/test/completion/operators.py @@ -0,0 +1,25 @@ +""" +Test Jedi's operation understanding. Jedi should understand simple additions, +multiplications, etc. +""" +x = [1, 'a', 1.0] + +#? int() str() float() +x[12] + +#? str() +x[1 + 1] + +index = 0 + 2 + +#? float() +x[index] + + +def calculate(number): + return number + constant + +constant = 1 + +#? float() +x[calculate(2)]