summaryrefslogtreecommitdiff
path: root/server/test/net/multiplayer_test.dart
diff options
context:
space:
mode:
Diffstat (limited to 'server/test/net/multiplayer_test.dart')
-rw-r--r--server/test/net/multiplayer_test.dart9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/test/net/multiplayer_test.dart b/server/test/net/multiplayer_test.dart
index e3bb225..b336501 100644
--- a/server/test/net/multiplayer_test.dart
+++ b/server/test/net/multiplayer_test.dart
@@ -376,13 +376,16 @@ void main() {
reason: 'current',
);
- // undo: the state rolls back (the index carries the undone action's
- // index, exactly like the reference app's server-side send).
+ // undo: the state rolls back. The wire index is the post-decrement one
+ // (the reference reports the pre-decrement index — its clients keep
+ // local state; our stateless web clients take the index at face value,
+ // so it must equal the state position). The description is the undone
+ // action's, as in the reference.
table.bob.send({'t': 'undo'});
for (final client in table.everyone) {
final update = await client.nextOf('update');
state = stateOf(update);
- expect(update['index'], indexAtTurnDone);
+ expect(update['index'], indexAtTurnDone - 1);
expect(
TestClient.characterIn(state, 'Banner Spear')?['turnState'],
1,