From 469988be9cdb8ed27c8b79379f7135d844b2facf Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Tue, 12 Aug 2014 09:57:00 +0200 Subject: [PATCH] actually add tests for the flow analysis of variables. --- test/completion/flow_analysis.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/completion/flow_analysis.py b/test/completion/flow_analysis.py index 52c75f35..c2e1c983 100644 --- a/test/completion/flow_analysis.py +++ b/test/completion/flow_analysis.py @@ -80,3 +80,31 @@ def elif_flows3(x): #? int() set elif_flows3(1) + +# ----------------- +# name resolution +# ----------------- + +a = list +def elif_name(x): + try: + if True: + a = 1 + elif 0: + a = 1.0 + else: + return '' + except ValueError: + a = x + return a + +#? int() set +elif_name(set) + +if 0: + a = '' +else: + a = int + +#? int +a