fix: eval 数组输出改读元素区

This commit is contained in:
2026-09-26 12:40:47 +00:00
parent 27718f27d5
commit 6310e8c671
2 changed files with 14 additions and 1 deletions
+12
View File
@@ -51,6 +51,18 @@ fn run_throw_script() {
assert!(!stderr.is_empty(), "run 失败应输出 stderr: {stderr}");
}
#[test]
fn eval_array_output() {
let output = Command::new(env!("CARGO_BIN_EXE_oxide"))
.args(["eval", "var a = [1, 2, 3]; a"])
.output()
.expect("failed to run oxide eval array");
assert!(output.status.success(), "eval array should exit 0");
let stdout = String::from_utf8_lossy(&output.stdout);
assert!(stdout.trim() == "[1, 2, 3]", "eval 数组应打印元素区内容: {stdout}");
}
#[test]
fn bench_help() {
let output = Command::new(env!("CARGO_BIN_EXE_oxide"))