From e4e446e10c66a3fde6bbf8eea20e94c6f060d14b Mon Sep 17 00:00:00 2001 From: pjh456 <147148383@qq.com> Date: Sat, 19 Sep 2026 17:11:14 +0000 Subject: [PATCH] =?UTF-8?q?test:=20concat=20=E6=B7=B7=E5=90=88=E5=AE=9E?= =?UTF-8?q?=E5=8F=82=E9=92=89=E8=A1=A5=20length=20=E8=A7=82=E5=AF=9F?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/array_hole_semantics_tests.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/oxide_builtins/tests/array_hole_semantics_tests.rs b/crates/oxide_builtins/tests/array_hole_semantics_tests.rs index d702f73b..85449a06 100644 --- a/crates/oxide_builtins/tests/array_hole_semantics_tests.rs +++ b/crates/oxide_builtins/tests/array_hole_semantics_tests.rs @@ -551,15 +551,16 @@ fn test_concat_empty_array_arg_expands_zero_elements() { } // 引擎钉:concat 多实参混合 present/空数组/非数组实参展开序与规范一致, -// 空数组实参中间穿插不占位;洞实参位保洞。 +// 空数组实参中间穿插不占位(length 观察面钉死);洞实参位保洞。 #[test] fn test_concat_mixed_args_order_and_holes() { let out = eval_str( - "(() => { const mixed = [].concat([], 5, []).join(','); \ - const ordered = [1].concat([2, 3], 0, []).join(','); \ + "(() => { const mixed = [].concat([], 5, []); \ + const ordered = [1].concat([2, 3], 0, []); \ const r = [].concat(new Array(1)); \ - return mixed + '|' + ordered + '|' + r.length + '|' + (0 in r); })()", + return mixed.join(',') + '|' + mixed.length + '|' + ordered.join(',') + '|' + \ + ordered.length + '|' + r.length + '|' + (0 in r); })()", ) .unwrap(); - assert_eq!(out, "5|1,2,3,0|1|false"); + assert_eq!(out, "5|1|1,2,3,0|4|1|false"); }