Skip to content

Commit

Permalink
Add union type test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
khatchad committed Dec 11, 2023
1 parent 5adbb39 commit 3a02b32
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import tensorflow as tf


def f(a):
pass


f(tf.constant(5))
f(5)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tensorflow==2.9.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import tensorflow as tf


def f(a):
pass


f(5)
f(tf.constant(5))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tensorflow==2.9.3
Original file line number Diff line number Diff line change
Expand Up @@ -5861,4 +5861,22 @@ public void testLikelyHasNonTensorParameter4() throws Exception {
assertTrue("This function has one tensor parameter and one non-tensor parameter.", f.getLikelyHasTensorParameter());
assertTrue("This function has one tensor parameter and one non-tensor parameter.", f.getLikelyHasNonTensorParameters());
}

@Test
public void testLikelyHasNonTensorParameter5() throws Exception {
Function f = getFunction("f");
assertTrue("This function has one parameter with one tensor argument and one non-tensor argument.",
f.getLikelyHasTensorParameter());
assertTrue("This function has one parameter with one tensor argument and one non-tensor argument.",
f.getLikelyHasNonTensorParameters());
}

@Test
public void testLikelyHasNonTensorParameter6() throws Exception {
Function f = getFunction("f");
assertTrue("This function has one parameter with one tensor argument and one non-tensor argument.",
f.getLikelyHasTensorParameter());
assertTrue("This function has one parameter with one tensor argument and one non-tensor argument.",
f.getLikelyHasNonTensorParameters());
}
}

0 comments on commit 3a02b32

Please sign in to comment.