mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
fix: eval 数组输出改读元素区
This commit is contained in:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user