fix: f64 转字符串 ryu 路径负数改追加防破坏非空缓冲前缀
This commit is contained in:
@@ -99,6 +99,13 @@ fn template_with_double_bigint_and_bool() {
|
||||
assert_eq!(to_str(&vm, result.unwrap()), "a1.5b123ctrued");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn template_with_negative_double_appends() {
|
||||
// 原语段负 double:result 已含 "x",负号必须追加在当前数前(ryu 路径)。
|
||||
let (vm, result) = eval_val("`x${-1.5}`");
|
||||
assert_eq!(to_str(&vm, result.unwrap()), "x-1.5");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn template_with_object_uses_tostring() {
|
||||
// 对象段保留完整 ToString(ToPrimitive 触发用户 toString)。
|
||||
|
||||
Reference in New Issue
Block a user