summaryrefslogtreecommitdiffhomepage
path: root/test/packetimpact/testbench/layers_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/packetimpact/testbench/layers_test.go')
-rw-r--r--test/packetimpact/testbench/layers_test.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/packetimpact/testbench/layers_test.go b/test/packetimpact/testbench/layers_test.go
index 8ffc26bf9..b32efda93 100644
--- a/test/packetimpact/testbench/layers_test.go
+++ b/test/packetimpact/testbench/layers_test.go
@@ -14,9 +14,11 @@
package testbench
-import "testing"
+import (
+ "testing"
-import "gvisor.dev/gvisor/pkg/tcpip"
+ "gvisor.dev/gvisor/pkg/tcpip"
+)
func TestLayerMatch(t *testing.T) {
var nilPayload *Payload
@@ -134,6 +136,16 @@ func TestLayerStringFormat(t *testing.T) {
"Type:4" +
"}",
},
+ {
+ name: "Payload",
+ l: &Payload{
+ Bytes: []byte("Hooray for packetimpact."),
+ },
+ want: "&testbench.Payload{Bytes:\n" +
+ "00000000 48 6f 6f 72 61 79 20 66 6f 72 20 70 61 63 6b 65 |Hooray for packe|\n" +
+ "00000010 74 69 6d 70 61 63 74 2e |timpact.|\n" +
+ "}",
+ },
} {
t.Run(tt.name, func(t *testing.T) {
if got := tt.l.String(); got != tt.want {