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

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


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

commit 94ceac6dee87505cbb58b30f5aa153b98d85da66
Author: Aaron Radzinzski <[email protected]>
AuthorDate: Mon Feb 22 19:45:13 2021 -0800

    WIP.
---
 .../org/apache/nlpcraft/common/makro/NCMacroCompilerSpec.scala | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/common/makro/NCMacroCompilerSpec.scala
 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/common/makro/NCMacroCompilerSpec.scala
index 123a18d..6180e99 100644
--- 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/common/makro/NCMacroCompilerSpec.scala
+++ 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/common/makro/NCMacroCompilerSpec.scala
@@ -77,15 +77,25 @@ class NCMacroCompilerSpec {
         checkEq("A {B | C | _}", Seq("A", "A B", "A C"))
         checkEq("{A}[2,2]", Seq("A A"))
         checkEq("{A}[1,2]", Seq("A", "A A"))
+        checkEq("{A|_|_|_|     _}[1,2]", Seq("", "A", "A A"))
         checkEq("{A}[1,2] {B}[2,2]", Seq("A B B", "A A B B"))
         checkEq("yy {xx A|_}[1,2] zz", Seq("yy zz", "yy xx A zz", "yy xx A xx 
A zz"))
         checkEq("yy {xx A|_}[0,2] zz", Seq("yy zz", "yy xx A zz", "yy xx A xx 
A zz"))
         checkEq("A {B| xxx {C|E}} D", Seq("A B D", "A xxx C D", "A xxx E D"))
+        checkEq("x {<OF>| y <NO>}[1,2]", Seq("x <OF>", "x y <NO>", "x <OF> 
<OF>", "x y <NO> y <NO>"))
+        checkEq("{{x  }} {<OF>| y <NO>}[1,2]", Seq("x <OF>", "x y <NO>", "x 
<OF> <OF>", "x y <NO> y <NO>"))
     }
 
     @Test
     def testFailCompiler(): Unit = {
         checkError("{A")
         checkError("{A}[2,1]")
+        checkError("{A}[1,0]")
+        checkError("{A}[2,]")
+        checkError("{A}[x,1]")
+        checkError("{A}[2.33, 1]")
+        checkError("{A}[1:1]")
+        checkError("{A}[1 1]")
+        checkError("{A|__}")
     }
 }

Reply via email to