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

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


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

commit f83bd1aed62eee5d7d5e9f79186786ddf13814ba
Author: Sergey Kamov <[email protected]>
AuthorDate: Tue Mar 23 21:05:38 2021 +0300

    WIP.
---
 .../model/intent/idl/compiler/functions/NCIdlFunctionsMeta.scala    | 5 ++---
 .../model/intent/idl/compiler/functions/NCIdlFunctionsOther.scala   | 6 ++++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/idl/compiler/functions/NCIdlFunctionsMeta.scala
 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/idl/compiler/functions/NCIdlFunctionsMeta.scala
index a136f53..f05802f 100644
--- 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/idl/compiler/functions/NCIdlFunctionsMeta.scala
+++ 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/idl/compiler/functions/NCIdlFunctionsMeta.scala
@@ -48,7 +48,6 @@ class NCIdlFunctionsMeta extends NCIdlFunctions {
             token = Some(tkn(meta = Map("k1" → "v1")))
         )
 
-
     @Test
     def testMetaRequest(): Unit =
         test(
@@ -109,8 +108,8 @@ class NCIdlFunctionsMeta extends NCIdlFunctions {
             )
         )
 
-    private def test(pred: String, idlCtx: ⇒ NCIdlContext = ctx(), token: 
Option[NCToken] = None): Unit =
+    private def test(f: String, idlCtx: ⇒ NCIdlContext = ctx(), token: 
Option[NCToken] = None): Unit =
         test(
-            TestDesc(truth = s"get($pred(), 'k1') == 'v1'", token = token, 
idlCtx = idlCtx)
+            TestDesc(truth = s"$f('k1') == 'v1'", token = token, idlCtx = 
idlCtx)
         )
 }
diff --git 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/idl/compiler/functions/NCIdlFunctionsOther.scala
 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/idl/compiler/functions/NCIdlFunctionsOther.scala
index b8c2e52..baa52e3 100644
--- 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/idl/compiler/functions/NCIdlFunctionsOther.scala
+++ 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/idl/compiler/functions/NCIdlFunctionsOther.scala
@@ -39,10 +39,12 @@ class NCIdlFunctionsOther extends NCIdlFunctions {
 
         sys.put("k1", "v1")
 
+        val js = "{\"k1\": \"v1\"}"
+
         // JSON.
         test(
-            "has(json(meta_sys()), 'k1') == true",
-            "has(json(meta_sys()), 'k2') == false"
+            s"has(json($js), 'k1') == true",
+            s"has(json($js), 'k2') == false"
         )
     }
 }

Reply via email to