test(test): 添加测试用例

This commit is contained in:
jing
2026-03-13 16:22:04 +08:00
parent e72944a36b
commit 1a5e05ea00
52 changed files with 7193 additions and 54 deletions

View File

@@ -28,7 +28,7 @@ Lab1 聚焦前端第一步:词法/语法分析。
1. 主要覆盖 `int main() { ... }` 这一固定函数形态。
2. 只包含少量声明/返回/表达式能力(用于演示完整流程)。
3. 示例用例位于 `test/test_case/simple_add.sy`
3. 示例用例位于 `test/test_case/function/simple_add.sy`
## 5. 构建与生成流程
@@ -68,7 +68,7 @@ cmake --build build -j "$(nproc)"
```bash
# 仅输出语法树
./build/bin/compiler --emit-parse-tree test/test_case/simple_add.sy
./build/bin/compiler --emit-parse-tree test/test_case/function/simple_add.sy
```
但最终不能只检查 `simple_add`。完成 Lab1 后,应至少对 `test/test_case` 下全部 `.sy` 用例逐个验证解析是否成功;如有需要,也可以自行编写批量测试脚本统一执行。