feat(client): add LocalBridge framing tests and diagonal fixtures
12 new tests covering framing roundtrips, cross-layer Protocol+framing integration, and diagonal wire mapping. 4 new diagonal movement fixtures generated from Rust for D-030 Layer 1 cross-language verification. 33/33 tests pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -167,3 +167,23 @@ func test_decode_player_input_empty_bytes() -> void:
|
||||
func test_encode_produces_nonempty_bytes() -> void:
|
||||
var bytes = Protocol.encode_player_input(1, "MoveNorth")
|
||||
assert_that(bytes.size()).is_greater(0)
|
||||
|
||||
|
||||
# -- Diagonal movement fixtures (D-030 Layer 1 cross-language) -----------------
|
||||
|
||||
func test_decode_diagonal_fixtures() -> void:
|
||||
# All 4 diagonal fixtures: clockwise NE, SE, SW, NW
|
||||
var diagonals: Array = [
|
||||
["input_move_northeast", "MoveNortheast"],
|
||||
["input_move_southeast", "MoveSoutheast"],
|
||||
["input_move_southwest", "MoveSouthwest"],
|
||||
["input_move_northwest", "MoveNorthwest"],
|
||||
]
|
||||
|
||||
for pair in diagonals:
|
||||
var bytes = _load_fixture(pair[0])
|
||||
var input: Variant = Protocol.decode_player_input(bytes)
|
||||
assert_that(input).is_not_null()
|
||||
assert_that(input.tick).is_equal(100)
|
||||
assert_that(input.action.variant).is_equal(pair[1])
|
||||
assert_that(input.action.data).is_null()
|
||||
|
||||
Reference in New Issue
Block a user