Add GNS load and reorder acceptance tests
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user