This is an automated email from the ASF dual-hosted git repository.

zhenchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git

commit 6edc10cda01c2915a4995ec961c90a41ff1d77ee
Author: Michal Stutzmann <[email protected]>
AuthorDate: Sat Aug 23 12:38:51 2025 +0200

    Add more tests
---
 .../calcite/sql/type/FunctionSqlTypeTest.java      | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git 
a/core/src/test/java/org/apache/calcite/sql/type/FunctionSqlTypeTest.java 
b/core/src/test/java/org/apache/calcite/sql/type/FunctionSqlTypeTest.java
index 3f780b3ecf..d9bc5e0c9d 100644
--- a/core/src/test/java/org/apache/calcite/sql/type/FunctionSqlTypeTest.java
+++ b/core/src/test/java/org/apache/calcite/sql/type/FunctionSqlTypeTest.java
@@ -25,6 +25,7 @@
 import org.junit.jupiter.api.Test;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 /**
  * Tests for {@link FunctionSqlType}.
@@ -37,11 +38,30 @@ public class FunctionSqlTypeTest {
       sqlTypeFactory.createStructType(
           ImmutableList.of(sqlTypeFactory.createSqlType(SqlTypeName.BOOLEAN)),
           ImmutableList.of("field1"));
+  final RelDataType nonStructParameterType = 
sqlTypeFactory.createSqlType(SqlTypeName.BOOLEAN);
   final RelDataType returnType = 
sqlTypeFactory.createSqlType(SqlTypeName.BOOLEAN);
   final FunctionSqlType functionSqlType =
       new FunctionSqlType(parameterType, returnType);
 
-  @Test void testGetParamType() {
+  @Test void testFailsOnNullParameterType() {
+    assertThrows(NullPointerException.class, () -> {
+      new FunctionSqlType(null, returnType);
+    });
+  }
+
+  @Test void testFailsOnNonStructParameterType() {
+    assertThrows(IllegalArgumentException.class, () -> {
+      new FunctionSqlType(nonStructParameterType, returnType);
+    });
+  }
+
+  @Test void testFailsOnNullReturnType() {
+    assertThrows(NullPointerException.class, () -> {
+      new FunctionSqlType(parameterType, null);
+    });
+  }
+
+  @Test void testGetParameterType() {
     assertEquals(parameterType, functionSqlType.getParameterType());
   }
 

Reply via email to