v1: executing-plans 模式生成,54 文件 1320 行 Python

This commit is contained in:
hangshuo652
2026-05-24 10:02:52 +08:00
commit 06b295f780
55 changed files with 1749 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import sys, os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
from comparator.rounding_detect import detect_rounding, RoundingResult
def test_truncation_detected():
r = detect_rounding("1500000", "1499999")
assert r.mode in ("TRUNCATE", "HALF_UP")
def test_exact_match():
r = detect_rounding("1500000", "1500000")
assert r.mode == "EXACT"
assert r.confidence == 1.0
def test_low_confidence_small_diff():
r = detect_rounding("1500", "1498")
assert r.confidence < 1.0
def test_suggestion_generated():
r = detect_rounding("1500000", "1499999")
assert len(r.suggestion) > 0