Skip to content

Commit 2129949

Browse files
committed
Python tests: Hide special ESSA variables in tests, to ease transition from '*' to '$' variable.
1 parent 28bea69 commit 2129949

File tree

6 files changed

+3
-22
lines changed

6 files changed

+3
-22
lines changed

python/ql/test/library-tests/PointsTo/new/Dataflow.expected

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
| __init__.py:0 | *_0 = ScopeEntryDefinition |
21
| __init__.py:0 | __name___0 = ScopeEntryDefinition |
32
| __init__.py:0 | __package___0 = ScopeEntryDefinition |
43
| __init__.py:0 | module2_0 = ImplicitSubModuleDefinition |
54
| __init__.py:0 | moduleX_0 = ImplicitSubModuleDefinition |
65
| __init__.py:0 | sys_0 = ScopeEntryDefinition |
7-
| __init__.py:1 | *_1 = ImportStarRefinement(*_0) |
86
| __init__.py:1 | __name___1 = ImportStarRefinement(__name___0) |
97
| __init__.py:1 | __package___1 = ImportStarRefinement(__package___0) |
108
| __init__.py:1 | sys_1 = ImportStarRefinement(sys_0) |
11-
| __init__.py:2 | *_2 = ImportStarRefinement(*_1) |
129
| __init__.py:2 | __name___2 = ImportStarRefinement(__name___1) |
1310
| __init__.py:2 | __package___2 = ImportStarRefinement(__package___1) |
1411
| __init__.py:2 | module_0 = ImportMember |
@@ -498,7 +495,6 @@
498495
| h_classes.py:52 | arg1_0 = ParameterDefinition |
499496
| h_classes.py:52 | n_0 = FunctionExpr |
500497
| h_classes.py:52 | self_0 = ParameterDefinition |
501-
| i_imports.py:0 | *_0 = ScopeEntryDefinition |
502498
| i_imports.py:0 | BytesIO_0 = ScopeEntryDefinition |
503499
| i_imports.py:0 | StringIO_0 = ScopeEntryDefinition |
504500
| i_imports.py:0 | __name___0 = ScopeEntryDefinition |
@@ -513,7 +509,6 @@
513509
| i_imports.py:3 | a_0 = IntegerLiteral |
514510
| i_imports.py:4 | b_0 = IntegerLiteral |
515511
| i_imports.py:5 | c_0 = IntegerLiteral |
516-
| i_imports.py:7 | *_1 = ImportStarRefinement(*_0) |
517512
| i_imports.py:7 | BytesIO_1 = ImportStarRefinement(BytesIO_0) |
518513
| i_imports.py:7 | StringIO_1 = ImportStarRefinement(StringIO_0) |
519514
| i_imports.py:7 | __name___1 = ImportStarRefinement(__name___0) |
@@ -528,7 +523,6 @@
528523
| i_imports.py:13 | argv_1 = ImportMember |
529524
| i_imports.py:17 | sys_1 = ImportExpr |
530525
| i_imports.py:23 | code_1 = ImportExpr |
531-
| i_imports.py:27 | *_2 = ImportStarRefinement(*_1) |
532526
| i_imports.py:27 | __name___2 = ImportStarRefinement(__name___1) |
533527
| i_imports.py:27 | __package___2 = ImportStarRefinement(__package___1) |
534528
| i_imports.py:27 | a_2 = ImportStarRefinement(a_1) |

python/ql/test/library-tests/PointsTo/new/Dataflow.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import python
44
import Util
55

66
from EssaVariable v, EssaDefinition def
7-
where def = v.getDefinition()
7+
where def = v.getDefinition() and not v.getSourceVariable() instanceof SpecialSsaSourceVariable
88
select locate(def.getLocation(), "abdefghijknrs_"), v.getRepresentation() + " = " + def.getRepresentation()

python/ql/test/library-tests/PointsTo/new/SsaAttr.expected

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,6 @@
3737
| g_class_init.py:52 | self_3 | version | phi(self_1, self_2) | 'v2' | runtime |
3838
| g_class_init.py:52 | self_3 | version | phi(self_1, self_2) | 'v3' | runtime |
3939
| g_class_init.py:54 | self_1 | version | Pi(self_0) [true] | 'v2' | runtime |
40-
| i_imports.py:7 | *_1 | x | ImportStarRefinement(*_0) | float 1.0 | import |
41-
| i_imports.py:7 | *_1 | y | ImportStarRefinement(*_0) | float 2.0 | import |
42-
| i_imports.py:27 | *_2 | module1 | ImportStarRefinement(*_1) | Module code.test_package.module1 | import |
43-
| i_imports.py:27 | *_2 | module2 | ImportStarRefinement(*_1) | Module code.test_package.module2 | import |
44-
| i_imports.py:27 | *_2 | p | ImportStarRefinement(*_1) | int 1 | import |
45-
| i_imports.py:27 | *_2 | q | ImportStarRefinement(*_1) | int 2 | import |
46-
| i_imports.py:27 | *_2 | r | ImportStarRefinement(*_1) | Dict | import |
47-
| i_imports.py:27 | *_2 | s | ImportStarRefinement(*_1) | NoneType None | import |
48-
| i_imports.py:27 | *_2 | x | ImportStarRefinement(*_1) | float 1.0 | import |
49-
| i_imports.py:27 | *_2 | y | ImportStarRefinement(*_1) | float 2.0 | import |
5040
| k_getsetattr.py:6 | self_0 | a | ParameterDefinition | float 7.0 | code/k_getsetattr.py:15 from runtime |
5141
| k_getsetattr.py:6 | self_0 | c | ParameterDefinition | int 2 | code/k_getsetattr.py:15 from runtime |
5242
| k_getsetattr.py:7 | self_1 | a | ArgumentRefinement(self_0) | int 0 | code/k_getsetattr.py:15 from runtime |

python/ql/test/library-tests/PointsTo/new/SsaAttr.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ private import semmle.python.pointsto.PointsToContext
55
import Util
66

77
from EssaVariable var, string name, Object o, PointsToContext ctx
8-
where PointsTo::Test::ssa_variable_named_attribute_points_to(var, ctx, name, o, _, _)
8+
where PointsTo::Test::ssa_variable_named_attribute_points_to(var, ctx, name, o, _, _) and not var.getSourceVariable() instanceof SpecialSsaSourceVariable
99
select
1010
locate(var.getDefinition().getLocation(), "abdfgikm"), var.getRepresentation(),
1111
name, var.getDefinition().getRepresentation(), repr(o), ctx

python/ql/test/library-tests/PointsTo/new/SsaUses.expected

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
| __init__.py:0 | *_2 | Exit node for Module code.test_package.__init__ |
21
| __init__.py:0 | __name___0 | Exit node for Module code.__init__ |
32
| __init__.py:0 | __name___0 | Exit node for Module code.package.__init__ |
43
| __init__.py:0 | __name___2 | Exit node for Module code.test_package.__init__ |
@@ -12,11 +11,9 @@
1211
| __init__.py:0 | moduleX_1 | Exit node for Module code.package.__init__ |
1312
| __init__.py:0 | module_0 | Exit node for Module code.package.__init__ |
1413
| __init__.py:0 | sys_2 | Exit node for Module code.test_package.__init__ |
15-
| __init__.py:1 | *_0 | ControlFlowNode for from module1 import * |
1614
| __init__.py:1 | __name___0 | ControlFlowNode for from module1 import * |
1715
| __init__.py:1 | __package___0 | ControlFlowNode for from module1 import * |
1816
| __init__.py:1 | sys_0 | ControlFlowNode for from module1 import * |
19-
| __init__.py:2 | *_1 | ControlFlowNode for from module2 import * |
2017
| __init__.py:2 | __name___1 | ControlFlowNode for from module2 import * |
2118
| __init__.py:2 | __package___1 | ControlFlowNode for from module2 import * |
2219
| __init__.py:2 | sys_1 | ControlFlowNode for from module2 import * |

python/ql/test/library-tests/PointsTo/new/SsaUses.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ import semmle.python.pointsto.PointsTo
55
import Util
66

77
from EssaVariable var, ControlFlowNode use
8-
where use = var.getAUse()
8+
where use = var.getAUse() and not var.getSourceVariable() instanceof SpecialSsaSourceVariable
99
select locate(use.getLocation(), "abdeghjks_"), var.getRepresentation(), use.toString()

0 commit comments

Comments
 (0)