v3: gstack-code-gen 生成

This commit is contained in:
hangshuo652
2026-05-24 12:36:44 +08:00
commit 818e81269c
50 changed files with 1343 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import sys, os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
from comparator.rounding_detect import detect_rounding
def test_truncation():
r = detect_rounding("1500000", "1499999")
assert r.mode in ("TRUNCATE", "HALF_UP")
def test_exact():
r = detect_rounding("1500000", "1500000")
assert r.mode == "EXACT"
assert r.confidence == 1.0
def test_small_diff():
r = detect_rounding("1500", "1498")
assert r.confidence < 1.0