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 af9b858 WIP.
af9b858 is described below
commit af9b858b1be3a288c36f0839814bde03ace94360
Author: Sergey Kamov <[email protected]>
AuthorDate: Thu Mar 25 10:36:12 2021 +0300
WIP.
---
.../idl/compiler/functions/NCIdlFunctionsMeta.scala | 5 ++++-
.../idl/compiler/functions/NCIdlFunctionsOther.scala | 18 +++++++++++-------
.../org/apache/nlpcraft/model/meta/NCMetaSpec.scala | 4 ++--
3 files changed, 17 insertions(+), 10 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 47deffb..296a806 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
@@ -36,7 +36,10 @@ class NCIdlFunctionsMeta extends NCIdlFunctions {
sys.put("k1", "v1")
- testValue("meta_sys")
+ try
+ testValue("meta_sys")
+ finally
+ sys.remove("k1")
}
@Test
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 a47e46e..5d1ebc9 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,13 +39,17 @@ class NCIdlFunctionsOther extends NCIdlFunctions {
sys.put("k1", "v1")
- val js = "{\"k1\": \"v1\"}"
-
- // JSON.
- test(
- s"has(keys(json('$js')), 'k1') == true",
- s"has(keys(json('$js')), 'k2') == false"
- )
+ try {
+ val js = "{\"k1\": \"v1\"}"
+
+ // JSON.
+ test(
+ s"has(keys(json('$js')), 'k1') == true",
+ s"has(keys(json('$js')), 'k2') == false"
+ )
+ }
+ finally
+ sys.remove("k1")
}
@Test
diff --git
a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/meta/NCMetaSpec.scala
b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/meta/NCMetaSpec.scala
index cd78857..b851629 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/meta/NCMetaSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/meta/NCMetaSpec.scala
@@ -141,9 +141,9 @@ class NCMetaSpec extends NCRestSpec {
require(getClient.ask("a").isOk)
}
finally {
- runTest(currUserCompMeta)
-
sys.remove("k1")
+
+ runTest(currUserCompMeta)
}
}
}