Add GNS load and reorder acceptance tests

This commit is contained in:
Nomads_Reach
2026-08-16 00:08:33 -04:00
parent ca962e4511
commit a56209c265
2 changed files with 143 additions and 0 deletions
+8
View File
@@ -36,6 +36,14 @@ def test_counter_and_window_enforce_latest_wins():
assert not window.accept(MAX_SEQUENCE)
def test_loss_and_reordering_do_not_stall_newer_snapshots():
window = SequenceWindow()
arrivals = (1, 3, 2, 6, 4, 5, 6, 8)
accepted = [sequence for sequence in arrivals if window.accept(sequence)]
assert accepted == [1, 3, 6, 8]
assert window.last_accepted == 8
def test_invalid_sequence_inputs_are_rejected():
assert not is_newer(-1, 0)
assert not is_newer(1, -1)