fix: 对照引擎 test262 结果为空时基准计分防除零

This commit is contained in:
2026-06-28 00:54:04 +08:00
parent 42277b9206
commit 63c44b1ac5
+4 -2
View File
@@ -334,12 +334,14 @@ def report(all_data):
if ox:
o_pass = ox.get("pass", 0); o_fail = ox.get("fail", 0); o_ran = o_pass + o_fail
q_pass = qj.get("pass", 0) if qj else 42000
q_fail = qj.get("fail", 0) if qj else 1000
o_rate = o_pass/o_ran*100 if o_ran else 0
w("## Test262\n")
w("| | OxideJS | QuickJS |")
w("|------|---------|------|")
w(f"| Pass | {o_pass:,} | {q_pass:,} |")
w(f"| Fail | {o_fail:,} | {qj.get('fail', 0):,} |")
w(f"| Rate | {o_pass/o_ran*100:.1f}% | ~99% |")
w(f"| Fail | {o_fail:,} | {q_fail:,} |")
w(f"| Rate | {o_rate:.1f}% | ~99% |")
w("")
# Timing