From 7b92e6ce423105852b9aedc378de5652b8080f9a Mon Sep 17 00:00:00 2001 From: ain ghazal Date: Fri, 2 Feb 2024 16:37:50 +0100 Subject: [PATCH] wip: ack duplicates compare set --- .../reliabletransport/reliable_ack_test.go | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/internal/reliabletransport/reliable_ack_test.go b/internal/reliabletransport/reliable_ack_test.go index 8fc9f5ed..e43b0337 100644 --- a/internal/reliabletransport/reliable_ack_test.go +++ b/internal/reliabletransport/reliable_ack_test.go @@ -60,6 +60,39 @@ func TestReliable_ACK(t *testing.T) { }, { name: "five reversed packets", + args: args{ + inputSequence: []string{ + "[5] CONTROL_V1 +1ms", + "[4] CONTROL_V1 +1ms", + "[3] CONTROL_V1 +1ms", + "[2] CONTROL_V1 +1ms", + "[1] CONTROL_V1 +1ms", + }, + start: 1, + wantacks: 5, + }, + }, + { + name: "ten unordered packets with duplicates", + args: args{ + inputSequence: []string{ + "[5] CONTROL_V1 +1ms", + "[1] CONTROL_V1 +1ms", + "[5] CONTROL_V1 +1ms", + "[2] CONTROL_V1 +1ms", + "[1] CONTROL_V1 +1ms", + "[4] CONTROL_V1 +1ms", + "[2] CONTROL_V1 +1ms", + "[3] CONTROL_V1 +1ms", + "[3] CONTROL_V1 +1ms", + "[4] CONTROL_V1 +1ms", + }, + start: 1, + wantacks: 5, + }, + }, + { + name: "ten packets", args: args{ inputSequence: []string{ "[5] CONTROL_V1 +1ms",