You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by ar...@apache.org on 2021/07/23 16:08:03 UTC

[incubator-nlpcraft] branch NLPCRAFT-369 updated: Test fix in NLPCRAFT-369

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

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


The following commit(s) were added to refs/heads/NLPCRAFT-369 by this push:
     new 7c3b63e  Test fix in NLPCRAFT-369
     new 67caf82  Merge branch 'NLPCRAFT-369' of https://github.com/apache/incubator-nlpcraft into NLPCRAFT-369
7c3b63e is described below

commit 7c3b63e499b09352a40542a85669a62efdb757ce
Author: Aaron Radzinski <ar...@datalingvo.com>
AuthorDate: Fri Jul 23 09:07:32 2021 -0700

    Test fix in NLPCRAFT-369
---
 .../scala/org/apache/nlpcraft/NCTestContext.scala    |  2 +-
 .../apache/nlpcraft/model/NCTrueIntentIdlSpec.scala  |  2 +-
 .../model/intent/idl/NCIdlIntentOptionsSpec.scala    |  4 ++--
 .../model/properties/NCTokensPropertiesSpec.scala    | 20 ++++++++++----------
 .../mgrs/nlp/enrichers/NCEnricherBaseSpec.scala      |  4 ++--
 5 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/NCTestContext.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/NCTestContext.scala
index 9487e55..ceae8a7 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/NCTestContext.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/NCTestContext.scala
@@ -135,7 +135,7 @@ abstract class NCTestContext {
       *
       * @param txts
       */
-    protected def fail(txts: String*): Unit =
+    protected def checkFail(txts: String*): Unit =
         for (txt <- txts)
             require(getClient.ask(txt).isFailed)
 
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/NCTrueIntentIdlSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/NCTrueIntentIdlSpec.scala
index 8f1b202..186d8cf 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/NCTrueIntentIdlSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/NCTrueIntentIdlSpec.scala
@@ -36,7 +36,7 @@ class NCTrueIntentIdlModel extends NCModelAdapter("nlpcraft.true.intent.test", "
 @NCTestEnvironment(model = classOf[NCTrueIntentIdlModel], startClient = true)
 class NCTrueIntentIdlSpec extends NCTestContext {
     @Test
-    def testStopWord(): Unit = fail("the")
+    def testStopWord(): Unit = checkFail("the")
 
     @Test
     def testNotStopWord(): Unit = checkIntent("test", "i")
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/idl/NCIdlIntentOptionsSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/idl/NCIdlIntentOptionsSpec.scala
index d4c6cd5..637bd7e 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/idl/NCIdlIntentOptionsSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/idl/NCIdlIntentOptionsSpec.scala
@@ -60,7 +60,7 @@ class NCIdlIntentOptionsModel extends NCAbstractTokensModel {
         "    term(a)={tok_id() == 'i2_a'}" +
         "    term(b)={tok_id() == 'i2_b'}"
     )
-    def i2(): NCResult = NCResult.text("i1")
+    def i2(): NCResult = NCResult.text("i2")
 
 }
 
@@ -69,7 +69,7 @@ class NCIdlIntentOptionsSpec extends NCMetaSpecAdapter {
     @Test
     def test(): Unit = {
         checkResult("i1_a i1_b", "i1")
-        fail("i1_b i1_a")
+        checkFail("i1_b i1_a")
 
         checkResult("i2_a i2_b", "i2")
         checkResult("i2_b i2_a", "i2")
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/properties/NCTokensPropertiesSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/properties/NCTokensPropertiesSpec.scala
index 5026387..5ab3635 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/properties/NCTokensPropertiesSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/properties/NCTokensPropertiesSpec.scala
@@ -86,14 +86,14 @@ class NCTokenPropertiesModel2Spec extends NCTestContext {
     def test(): Unit = {
         checkIntent("a b", "onAB")
         checkIntent("a test test b", "onAB")
-        fail(
+        checkFail(
             "b a",
             "b test test a"
         )
 
         checkIntent("x y", "onXY")
         checkIntent("x test test y", "onXY")
-        fail(
+        checkFail(
             "b a",
             "b test test a",
             "y x",
@@ -117,7 +117,7 @@ class NCTokenPropertiesModel3Spec extends NCTestContext {
         checkIntent("y x", "onXY")
         checkIntent("x y", "onXY")
 
-        fail(
+        checkFail(
             "a test b",
             "b test a",
             "x test y",
@@ -142,7 +142,7 @@ class NCTokenPropertiesModel4Spec extends NCTestContext {
     @Test
     def test(): Unit = {
         checkIntent("a b", "onAB")
-        fail(
+        checkFail(
             "b a",
             "a test b",
             "b test a"
@@ -172,7 +172,7 @@ class NCTokenPropertiesModel5Spec extends NCTestContext {
     def test(): Unit = {
         checkIntent("a b", "onAB")
         checkIntent("a test test b", "onAB")
-        fail("b a")
+        checkFail("b a")
 
         checkIntent("x y", "onXY")
         checkIntent("x test test y", "onXY")
@@ -201,18 +201,18 @@ class NCTokenPropertiesModel6Spec extends NCTestContext {
     @Test
     def test(): Unit = {
         checkIntent("a b", "onAB")
-        fail("b a")
+        checkFail("b a")
         checkIntent("y x", "onXY")
         checkIntent("x y", "onXY")
 
-        fail(
+        checkFail(
             "a test b",
             "b test a"
         )
         checkIntent("y test x", "onXY")
         checkIntent("x test y", "onXY")
 
-        fail(
+        checkFail(
             "a test test b",
             "b test test a"
         )
@@ -242,8 +242,8 @@ class NCTokenPropertiesModel7Spec extends NCTestContext {
     def test(): Unit = {
         checkIntent("a b", "onAB")
         checkIntent("b a", "onAB")
-        fail("a test b")
-        fail("b test a")
+        checkFail("a test b")
+        checkFail("b test a")
         checkIntent("y x", "onXY")
         checkIntent("x y", "onXY")
         checkIntent("y test test x", "onXY")
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/NCEnricherBaseSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/NCEnricherBaseSpec.scala
index 07e0eea..3c9b8e1 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/NCEnricherBaseSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/NCEnricherBaseSpec.scala
@@ -52,7 +52,7 @@ abstract class NCEnricherBaseSpec extends NCTestContext {
         val res = cli.ask(txt)
 
         if (res.isFailed)
-            fail(s"Result failed [" +
+            checkFail(s"Result failed [" +
                 s"text=$txt, " +
                 s"error=${res.getResultError.get()}" +
             s"]")
@@ -84,7 +84,7 @@ abstract class NCEnricherBaseSpec extends NCTestContext {
         val res = cli.ask(txt)
 
         if (res.isFailed)
-            fail(s"Result failed [" +
+            checkFail(s"Result failed [" +
                 s"text=$txt, " +
                 s"error=${res.getResultError.get()}" +
             s"]")