Skip to content

Commit

Permalink
test: ✅ 初步增加有关NARust-158的测试代码
Browse files Browse the repository at this point in the history
  • Loading branch information
ARCJ137442 committed Sep 12, 2024
1 parent 6a8fade commit ea7b55d
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "babel_nar_cli"
version = "0.2.0"
version = "0.2.1"
edition = "2021"
description = """
Command Line Interface (CLI) of BabelNAR.rs
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
| 语句输入 | `<A --> B>.` + `<B --> C>.` | `<<A --> B> ==> <C --> D>>.` + `<A --> B>.` | `<<A --> $1> ==> <$1 --> C>>.` + `<A --> B>.` | `<A --> B>. :\|:` + `<C --> D>. :\|:` | `<(*, ...) --> ^left>! :\|:` | `A. :\|:` + `<(*, {SELF}) --> ^left>. :\|:` + `G. :\|:` + `<(&/, A, <(*, ...) --> ^left>) ==> G>?` + `G! :\|:` |
| 预期输出 | `<A --> C>.` | `<C --> D>.` | `<B --> C>.` | `<<A --> B> =/> <C --> D>>.` | EXE `<(*, ...) --> ^left> :\|:` | EXE `<(&/, A, <(*, ...) --> ^left>) ==> G>` |
| OpenNARS(3.0.4) |||||||
| OpenNARS(1.5.8) |||||||
| ONA |||||||
| PyNARS |||||||
| CXinNARS |||||||
| NARust-158 |||||||

## 参考

Expand Down
16 changes: 16 additions & 0 deletions src/tests/cli/config/cin_narust_158.hjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#hjson
// * 🎯用于测试NARust-158
// * ✨纯Rust编写的完整OpenNARS 1.5.8复刻版本
{
// 使用「原生」输入输出转译器
translators: native
command: {
// * ⚠️必须前缀`./`以指定是「启动当前工作目录下的exe文件」
cmd: ./narust_158_batch.exe
cmdArgs: []
// * 🚩现在基于「固定位置的CIN程序包」运行测试
// * 回溯路径:config(`./`) => cli => tests => src => BabelNAR.rs / executables
currentDir: ./../../../../executables
}
autoRestart: true
}
2 changes: 2 additions & 0 deletions src/tests/config_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ nar_dev_utils::macro_once! {
CXIN_JS = "./src/tests/cli/config/cin_cxin_js.hjson"
/// 原生IL-1
NATIVE_IL_1 = "./src/tests/cli/config/cin_native_il_1.hjson"
/// NARust-158
NARUST_158 = "./src/tests/cli/config/cin_narust_158.hjson"

/// 预引入/NAL测试环境
PRELUDE_TEST = "./src/tests/cli/config/prelude_test.hjson"
Expand Down
38 changes: 38 additions & 0 deletions src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,44 @@ mod native_il_1 {
}
}

/// 测试/NARust-158
mod narust_158 {
use super::*;

cin_tests! {
NARUST_158;
// TODO: 彻查「推理测试」无响应的bug

/// 真值通配
/// * ✅【2024-09-13 01:31:29】成功
nal_tw => NAL_TRUTH_WILDCARD

/// 简单演绎
/// * ✅【2024-09-13 01:31:34】成功
nal_de => NAL_SIMPLE_DEDUCTION

/// 高阶演绎
/// * ✅【2024-09-13 01:31:39】成功
nal_hi => NAL_HIGHER_DEDUCTION

/// 自变量消除
/// * ✅【2024-09-13 01:31:44】成功
nal_ie => NAL_I_VAR_ELIMINATION

/// 时间归纳
/// * ❌【2024-09-13 01:31:49】不支持
nal_te => NAL_TEMPORAL_INDUCTION

/// 简单操作
/// * ❌【2024-09-13 01:31:56】不支持
nal_so => NAL_SIMPLE_OPERATION

/// 操作
/// * ❌【2024-09-13 01:32:02】不支持
nal_op => NAL_OPERATION
}
}

// ! ❌【2024-04-07 14:39:20】接口完成度不高的NARS-Python、OpenJunars暂不进行测试

/// 测试入口/带Websocket Shell
Expand Down

0 comments on commit ea7b55d

Please sign in to comment.