Files
horizon-airdef/tests/test_block_state_codec_parity.py
T
Ludovic Marie cb19660fbe Build Horizon Rust parity foundations and differential validation
Add version-bound core, world data, geometry, generation and feature implementations with native client/server comparison tools and scoped evidence reports. Apply Horizon project branding.

Workspace tests, Clippy and 147 Python tests passed. Full 51-family survival and expanded provider comparisons are still running; complete gameplay parity and a playable Rust client remain unfinished. Private game artifacts and the isolated simple-block placement work are excluded.
2026-10-06 11:24:51 +02:00

20 lines
999 B
Python

import json
import unittest
from tools import test_block_state_codec_parity as block
class BlockStateCodecCorpusTests(unittest.TestCase):
def test_modes_property_defaults_and_integer_boundaries(self):
facts={'states':[{'id':'minecraft:stone'},{'id':'minecraft:water','properties':{'level':'0'}}], 'defaults':{'minecraft:stone':0,'minecraft:water':1},'integers':[['minecraft:water','level']]}
fixtures=list(block.corpus(facts))
self.assertEqual(fixtures,list(block.corpus(facts)))
self.assertEqual({f[0] for f in fixtures},{False,True})
values=[json.loads(f[1]) for f in fixtures]
for value in ['+01','-2147483649','\u0660\u0661','\uff10\uff11','\U0001d7d9']:
self.assertIn({'id':'minecraft:water','properties':{'level':value}},values)
self.assertIn({'id':'minecraft:stone','properties':False},values)
self.assertTrue(any('"level":"0","level":"1"' in f[1] for f in fixtures))
if __name__=='__main__':unittest.main()