Skip to content

Commit

Permalink
Add tests for wala#205.
Browse files Browse the repository at this point in the history
  • Loading branch information
khatchad committed Jul 11, 2024
1 parent 2f092cd commit 4633106
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2802,6 +2802,34 @@ public void testModule67()
new int[] {3});
}

/** Test https://github.com/wala/ML/issues/205. */
@Test(expected = java.lang.AssertionError.class)
public void testModule68()
throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
test(
new String[] {"proj63/src/__init__.py", "proj63/src/module.py", "proj63/client.py"},
"src/module.py",
"f",
"proj63",
1,
1,
new int[] {2});
}

/** Test https://github.com/wala/ML/issues/205. */
@Test(expected = java.lang.IllegalStateException.class)
public void testModule69()
throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
test(
new String[] {"proj64/src/__init__.py", "proj64/src/module.py", "proj64/client.py"},
"src/module.py",
"f",
"proj64",
1,
1,
new int[] {2});
}

@Test
public void testStaticMethod() throws ClassHierarchyException, CancelException, IOException {
test("tf2_test_static_method.py", "MyClass.the_static_method", 1, 1, 2);
Expand Down
6 changes: 6 additions & 0 deletions com.ibm.wala.cast.python.test/data/proj63/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Test https://github.com/wala/ML/issues/163.

from tensorflow import ones
from src import f

f(ones([1, 2]))
1 change: 1 addition & 0 deletions com.ibm.wala.cast.python.test/data/proj63/src/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .module import f
16 changes: 16 additions & 0 deletions com.ibm.wala.cast.python.test/data/proj63/src/module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Test https://github.com/wala/ML/issues/163.

from tensorflow import Tensor
from typing import NamedTuple, List
import tensorflow as tf


class GNNInput(NamedTuple):
node_embeddings: tf.Tensor
adjacency_lists: List
edge_weights: List
etan: tf.Tensor


def f(a):
assert isinstance(a, Tensor)
6 changes: 6 additions & 0 deletions com.ibm.wala.cast.python.test/data/proj64/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Test https://github.com/wala/ML/issues/163.

from tensorflow import ones
from src import f

f(ones([1, 2]))
1 change: 1 addition & 0 deletions com.ibm.wala.cast.python.test/data/proj64/src/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .module import *
16 changes: 16 additions & 0 deletions com.ibm.wala.cast.python.test/data/proj64/src/module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Test https://github.com/wala/ML/issues/163.

from tensorflow import Tensor
from typing import NamedTuple, List
import tensorflow as tf


class GNNInput(NamedTuple):
node_embeddings: tf.Tensor
adjacency_lists: List
edge_weights: List
etan: tf.Tensor


def f(a):
assert isinstance(a, Tensor)

0 comments on commit 4633106

Please sign in to comment.