feat: complete Chinese tutorial text and layout validation

This commit is contained in:
DragonHD
2026-09-20 12:10:30 +08:00
parent 6cd5bcbfee
commit b7ae04ec18
7 changed files with 124 additions and 6 deletions
+4 -4
View File
@@ -1,4 +1,4 @@
"""Verify the bounded first five tutorial groups against an original backup."""
"""Verify the bounded complete tutorial translation against an original backup."""
import argparse
import hashlib
import json
@@ -25,7 +25,7 @@ def main():
assert result == patch_display_calls(source, mapping, allow_alignment_changes=True), 'build mismatch'
before = extract_display_literals(source)
after = extract_display_literals(result, encoding='gb2312')
assert len(before) == len(after) == 55
assert len(before) == len(after) == 57
changed = []
left = right = 0
for i, (a, b) in enumerate(zip(before, after)):
@@ -38,8 +38,8 @@ def main():
assert source[a.start:a.end] == result[b.start:b.end]
left, right = a.end, b.end
assert source[left:] == result[right:], 'trailing bytes changed'
assert changed == list(range(15)), changed
print('MODIFIED: first 15 of 55 literals translated; all other bytes unchanged; PASS')
assert changed == list(range(57)), changed
print('MODIFIED: all 57 display literals translated; all other bytes unchanged; PASS')
if __name__ == '__main__':