This is an automated email from the ASF dual-hosted git repository. ifropc pushed a commit to branch NLPCRAFT-91 in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
commit bf11d2b007571c3e1ee2374d75dda6ff3690bdb3 Author: Ifropc <[email protected]> AuthorDate: Sat Mar 6 10:28:58 2021 -0800 NLPCRAFT-91: Add basic test --- nlpcraft-examples/minecraft-model/pom.xml | 7 ++++ .../nlpcraft/example/NCMinecraftModelSpec.kt | 37 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/nlpcraft-examples/minecraft-model/pom.xml b/nlpcraft-examples/minecraft-model/pom.xml index 8a221aa..ccb7793 100644 --- a/nlpcraft-examples/minecraft-model/pom.xml +++ b/nlpcraft-examples/minecraft-model/pom.xml @@ -52,6 +52,13 @@ <artifactId>junit-jupiter-engine</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>nlpcraft</artifactId> + <version>${project.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> </dependencies> <build> diff --git a/nlpcraft-examples/minecraft-model/src/test/kotlin/org/apache/nlpcraft/example/NCMinecraftModelSpec.kt b/nlpcraft-examples/minecraft-model/src/test/kotlin/org/apache/nlpcraft/example/NCMinecraftModelSpec.kt new file mode 100644 index 0000000..a7fbc66 --- /dev/null +++ b/nlpcraft-examples/minecraft-model/src/test/kotlin/org/apache/nlpcraft/example/NCMinecraftModelSpec.kt @@ -0,0 +1,37 @@ +/* + * 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 + * + * http://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.example + +import org.apache.nlpcraft.NCTestContext +import org.apache.nlpcraft.NCTestEnvironment +import org.junit.jupiter.api.Test +import kotlin.test.assertEquals + + +@NCTestEnvironment(model = MinecraftModel::class, startClient = true) +class NCMinecraftModelSpec : NCTestContext() { + @Test + fun test() { + val res = client.ask("make a box of sand with the size of 2 10 meters in front of me") + assertEquals( + "execute at @p positioned ~0 ~0 ~10 rotated 0 0 run fill ^-1 ^0 ^-1 ^0 ^0 ^0 minecraft:sand", + res.result.get() + ) + } +} \ No newline at end of file
