feat: complete xxf-ch5 35 features migration, protocol bindings, and gate validation
- S1: Chinese locale pack, target HP/drop preview, elemental icons, exchange level display, item highlight, FOV settings, advanced skybox, GM warp. - S2: 5-page 225-slot inventory, seamless channel switch, wiki/drop query/chest preview. - S3: Auto-refine/attribute locks, sash combine/absorb, talisman/elemental stats, costume/mount/shining slots, changelook, soulbind, glove, quiver, magic reduction. - S4: Modern cube renewal, mythic dragon soul (6 grades/1152 slots), DS attr change, global rankings, dice system. - S5: Multi-token shop, offline private shop search, offline shop state machine, 64-bit gold alignment, Won dual currency exchange. - S6: Single account 5-character slot adaptive wire protocol, Wolfman profession & claw weapon/applies, Conqueror level & Sungma attributes, pets & 6th/7th attrs, battle pass & boss tracking. - Pass 42/42 platform gate test suites in scripts/port_gate.sh macos.
This commit is contained in:
@@ -73,7 +73,7 @@ class WikiSelectionTests(unittest.TestCase):
|
||||
|
||||
class NativeFinderInputTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
fn=next(n for n in ast.parse(script('Ava2NativeInterfacesScript.inc')).body if isinstance(n,ast.FunctionDef) and n.name=='DropValue')
|
||||
fn=next(n for n in ast.walk(ast.parse(script('Ava2NativeInterfacesScript.inc'))) if isinstance(n,ast.FunctionDef) and n.name=='DropValue')
|
||||
self.ns=dict(ui=types.SimpleNamespace(EditLine=types.SimpleNamespace(OnIMEUpdate=lambda self:None)),uiDropItem=types.SimpleNamespace(ITEM_LIST=[{'name':'orc tooth','vnum':30006},{'name':'orc bone','vnum':30007}]))
|
||||
exec(compile(ast.Module(body=[fn],type_ignores=[]),'<finder>','exec'),self.ns)
|
||||
self.rows=[];self.visible=False;self.text='';self.widget=types.SimpleNamespace(get_vnum=123,ItemNameValue=types.SimpleNamespace(GetText=lambda:self.text),DropDownList=types.SimpleNamespace(DropList=types.SimpleNamespace(SetViewItemCount=lambda count:None,SetBasePos=lambda pos:None),Clear=self.rows.clear,AppendItem=lambda *row:self.rows.append(row),Show=lambda:setattr(self,'visible',True),Hide=lambda:setattr(self,'visible',False)))
|
||||
@@ -89,4 +89,13 @@ class SourceTests(unittest.TestCase):
|
||||
if not path.exists():self.skipTest('AVA2 source is not installed')
|
||||
raw=path.read_bytes();self.assertEqual(hashlib.sha256(raw).hexdigest(),meta['sha256'])
|
||||
self.assertEqual(script('Ava2'+meta['module']+'Source.inc'),'# -*- coding: utf-8 -*-\n'+raw.decode('cp1254').replace('\r\n','\n')+'\n')
|
||||
|
||||
class MoneyFormattingTests(unittest.TestCase):
|
||||
def test_actual_formatter_keeps_exact_payment_amount(self):
|
||||
tree=ast.parse(script('Ava2NativeInterfacesScript.inc'))
|
||||
fn=next(n for n in ast.walk(tree) if isinstance(n,ast.FunctionDef) and n.name=='_FormatMoney64')
|
||||
ns={'long':int};exec(compile(ast.Module(body=[fn],type_ignores=[]),'<money>','exec'),ns)
|
||||
for amount in (0,5000000000,100000000000,1999999999999999,2000000000000000):
|
||||
self.assertEqual(ns['_FormatMoney64'](amount),format(amount,','))
|
||||
|
||||
if __name__=='__main__':unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user