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

sergeykamov pushed a commit to branch NLPCRAFT-473
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/NLPCRAFT-473 by this push:
     new 5e09e21  WIP.
5e09e21 is described below

commit 5e09e2171950c6c4e05a5047731fd86d503d81e4
Author: Sergey Kamov <[email protected]>
AuthorDate: Fri Jan 28 23:31:16 2022 +0300

    WIP.
---
 .../internal/impl/scan/NCIntentImportSpec.scala    | 30 ----------------------
 .../intent/compiler/NCIDLCompilerSpec.scala        | 18 +++++++++++++
 2 files changed, 18 insertions(+), 30 deletions(-)

diff --git 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/scan/NCIntentImportSpec.scala
 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/scan/NCIntentImportSpec.scala
deleted file mode 100644
index 5d176da..0000000
--- 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/scan/NCIntentImportSpec.scala
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nlpcraft.internal.impl.scan
-
-import org.apache.nlpcraft.internal.intent.compiler.NCIDLCompiler
-import org.junit.jupiter.api.Test
-import org.apache.nlpcraft.nlp.util.opennlp.*
-
-/**
-  *
-  */
-class NCIntentImportSpec:
-    @Test
-    def test(): Unit = require(NCIDLCompiler.compile("import('scan/idl.idl')", 
CFG, "-").size == 1)
-
diff --git 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCompilerSpec.scala
 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCompilerSpec.scala
index 4471ef4..b418e26 100644
--- 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCompilerSpec.scala
+++ 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCompilerSpec.scala
@@ -290,3 +290,21 @@ class NCIDLCompilerSpec:
               |     fragment(f1_, {'a': true, 'b': ["s1", "s2"]})
               |""".stripMargin
         )
+
+    @Test
+    def testImport(): Unit = 
require(NCIDLCompiler.compile("import('scan/idl.idl')", CFG, "-").size == 1)
+
+    @Test
+    def testEmpty(): Unit =
+        def test0(f: () => Unit): Unit =
+            try
+                f()
+
+                require(false)
+            catch
+                case e: NCException => println(s"Expected error: ${e}")
+
+        test0(() => NCIDLCompiler.compile("", CFG, "-"))
+        test0(() => NCIDLCompiler.compile(" ", CFG, "-"))
+        test0(() => NCIDLCompiler.compile(null, CFG, "-"))
+

Reply via email to