Skip to content

Commit

Permalink
Add user-defined superclass.
Browse files Browse the repository at this point in the history
  • Loading branch information
khatchad committed Nov 30, 2023
1 parent 2419b0d commit 5a47958
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
13 changes: 13 additions & 0 deletions com.ibm.wala.cast.python.test/data/callables5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class D:
pass


class C(D):

def __call__(self, x):
return x * x


c = C()
a = c.__call__(5)
assert a == 25
13 changes: 13 additions & 0 deletions com.ibm.wala.cast.python.test/data/callables6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class D:
pass


class C(D):

def __call__(self, x):
return x * x


c = C()
a = c(5)
assert a == 25
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class TestCallables extends TestPythonCallGraphShape {
@Test
public void testCallables()
throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
final String[] testFileNames = {"callables.py", "callables2.py", "callables3.py", "callables4.py"};
final String[] testFileNames = {"callables.py", "callables2.py", "callables3.py", "callables4.py", "callables5.py", "callables6.py"};

for (String fileName : testFileNames) {
PythonAnalysisEngine<?> E = makeEngine(fileName);
Expand Down

0 comments on commit 5a47958

Please sign in to comment.