test(protocol): update final hello fixtures
- commit
- bcae23b153d48fbdb6393edf3906b3c3de7f97f0
- author
- brice · · 2026-08-03 07:19 UTC
- committer
- brice · · 2026-08-04 03:19 UTC
- parent
- 0929f70
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +6 -4
M internal/adapters/dgram/proxy_test.go +4 -3
| @@ -10,6 +10,7 @@ import ( | |||
| 10 | 10 | "testing" | |
| 11 | 11 | "time" | |
| 12 | 12 | ||
| 13 | + | "github.com/bnema/vev/internal/domain" | |
| 13 | 14 | "github.com/bnema/vev/internal/ports" | |
| 14 | 15 | ) | |
| 15 | 16 | ||
| @@ -87,7 +88,7 @@ func TestProxyRuntimeClampsDatagramHelloOutputWindowAndPreservesControl(t *testi | |||
| 87 | 88 | daemon := newFakeTransport() | |
| 88 | 89 | errCh := make(chan error, 1) | |
| 89 | 90 | go func() { errCh <- ProxyRuntime{Client: client, Daemon: daemon, IdleTTL: time.Hour}.Run(t.Context()) }() | |
| 90 | - | hello := ports.Hello{Version: ports.ProtocolVersion, Intent: ports.IntentAttach, Name: "work", MaxOutputInFlight: requested} | |
| 91 | + | hello := ports.Hello{Version: ports.ProtocolVersion, Intent: ports.IntentAttach, Name: "work", Size: domain.Size{Cols: 80, Rows: 24}, MaxOutputInFlight: requested} | |
| 91 | 92 | client.recv <- recvResult{frame: ports.Frame{Type: ports.MsgHello, Payload: ports.MarshalHello(hello)}} | |
| 92 | 93 | ||
| 93 | 94 | select { | |
| @@ -488,7 +489,7 @@ func TestProxyCopierStopsRetryingWhenContextCanceled(t *testing.T) { | |||
| 488 | 489 | ||
| 489 | 490 | func TestClampDatagramHelloOutputWindowPreservesProtocolValidation(t *testing.T) { | |
| 490 | 491 | t.Run("malformed payload remains malformed", func(t *testing.T) { | |
| 491 | - | payload := append(ports.MarshalHello(ports.Hello{Version: ports.ProtocolVersion, MaxOutputInFlight: 8}), 0xff) | |
| 492 | + | payload := append(ports.MarshalHello(ports.Hello{Version: ports.ProtocolVersion, Size: domain.Size{Cols: 80, Rows: 24}, MaxOutputInFlight: 8}), 0xff) | |
| 492 | 493 | frame := ports.Frame{Type: ports.MsgHello, Payload: payload} | |
| 493 | 494 | got := clampDatagramHelloOutputWindow(frame) | |
| 494 | 495 | if !reflect.DeepEqual(got, frame) { | |
| @@ -502,7 +503,7 @@ func TestClampDatagramHelloOutputWindowPreservesProtocolValidation(t *testing.T) | |||
| 502 | 503 | t.Run("mismatched version remains mismatched", func(t *testing.T) { | |
| 503 | 504 | wantVersion := ports.ProtocolVersion + 1 | |
| 504 | 505 | frame := ports.Frame{Type: ports.MsgHello, Payload: ports.MarshalHello(ports.Hello{ | |
| 505 | - | Version: wantVersion, MaxOutputInFlight: 8, | |
| 506 | + | Version: wantVersion, Size: domain.Size{Cols: 80, Rows: 24}, MaxOutputInFlight: 8, | |
| 506 | 507 | })} | |
| 507 | 508 | got, err := ports.UnmarshalHello(clampDatagramHelloOutputWindow(frame).Payload) | |
| 508 | 509 | if err != nil { | |
| @@ -10,6 +10,7 @@ import ( | |||||
| 10 | "testing" | 10 | "testing" | ||
| 11 | "time" | 11 | "time" | ||
| 12 | 12 | ||||
| 13 | + | "github.com/bnema/vev/internal/domain" | |||
| 13 | "github.com/bnema/vev/internal/ports" | 14 | "github.com/bnema/vev/internal/ports" | ||
| 14 | ) | 15 | ) | ||
| 15 | 16 | ||||
| @@ -87,7 +88,7 @@ func TestProxyRuntimeClampsDatagramHelloOutputWindowAndPreservesControl(t *testi | |||||
| 87 | daemon := newFakeTransport() | 88 | daemon := newFakeTransport() | ||
| 88 | errCh := make(chan error, 1) | 89 | errCh := make(chan error, 1) | ||
| 89 | go func() { errCh <- ProxyRuntime{Client: client, Daemon: daemon, IdleTTL: time.Hour}.Run(t.Context()) }() | 90 | go func() { errCh <- ProxyRuntime{Client: client, Daemon: daemon, IdleTTL: time.Hour}.Run(t.Context()) }() | ||
| 90 | - | hello := ports.Hello{Version: ports.ProtocolVersion, Intent: ports.IntentAttach, Name: "work", MaxOutputInFlight: requested} | 91 | + | hello := ports.Hello{Version: ports.ProtocolVersion, Intent: ports.IntentAttach, Name: "work", Size: domain.Size{Cols: 80, Rows: 24}, MaxOutputInFlight: requested} |
| 91 | client.recv <- recvResult{frame: ports.Frame{Type: ports.MsgHello, Payload: ports.MarshalHello(hello)}} | 92 | client.recv <- recvResult{frame: ports.Frame{Type: ports.MsgHello, Payload: ports.MarshalHello(hello)}} | ||
| 92 | 93 | ||||
| 93 | select { | 94 | select { | ||
| @@ -488,7 +489,7 @@ func TestProxyCopierStopsRetryingWhenContextCanceled(t *testing.T) { | |||||
| 488 | 489 | ||||
| 489 | func TestClampDatagramHelloOutputWindowPreservesProtocolValidation(t *testing.T) { | 490 | func TestClampDatagramHelloOutputWindowPreservesProtocolValidation(t *testing.T) { | ||
| 490 | t.Run("malformed payload remains malformed", func(t *testing.T) { | 491 | t.Run("malformed payload remains malformed", func(t *testing.T) { | ||
| 491 | - | payload := append(ports.MarshalHello(ports.Hello{Version: ports.ProtocolVersion, MaxOutputInFlight: 8}), 0xff) | 492 | + | payload := append(ports.MarshalHello(ports.Hello{Version: ports.ProtocolVersion, Size: domain.Size{Cols: 80, Rows: 24}, MaxOutputInFlight: 8}), 0xff) |
| 492 | frame := ports.Frame{Type: ports.MsgHello, Payload: payload} | 493 | frame := ports.Frame{Type: ports.MsgHello, Payload: payload} | ||
| 493 | got := clampDatagramHelloOutputWindow(frame) | 494 | got := clampDatagramHelloOutputWindow(frame) | ||
| 494 | if !reflect.DeepEqual(got, frame) { | 495 | if !reflect.DeepEqual(got, frame) { | ||
| @@ -502,7 +503,7 @@ func TestClampDatagramHelloOutputWindowPreservesProtocolValidation(t *testing.T) | |||||
| 502 | t.Run("mismatched version remains mismatched", func(t *testing.T) { | 503 | t.Run("mismatched version remains mismatched", func(t *testing.T) { | ||
| 503 | wantVersion := ports.ProtocolVersion + 1 | 504 | wantVersion := ports.ProtocolVersion + 1 | ||
| 504 | frame := ports.Frame{Type: ports.MsgHello, Payload: ports.MarshalHello(ports.Hello{ | 505 | frame := ports.Frame{Type: ports.MsgHello, Payload: ports.MarshalHello(ports.Hello{ | ||
| 505 | - | Version: wantVersion, MaxOutputInFlight: 8, | 506 | + | Version: wantVersion, Size: domain.Size{Cols: 80, Rows: 24}, MaxOutputInFlight: 8, |
| 506 | })} | 507 | })} | ||
| 507 | got, err := ports.UnmarshalHello(clampDatagramHelloOutputWindow(frame).Payload) | 508 | got, err := ports.UnmarshalHello(clampDatagramHelloOutputWindow(frame).Payload) | ||
| 508 | if err != nil { | 509 | if err != nil { | ||
M internal/adapters/sshstdio/transport_test.go +2 -1
| @@ -12,6 +12,7 @@ import ( | |||
| 12 | 12 | "testing" | |
| 13 | 13 | "time" | |
| 14 | 14 | ||
| 15 | + | "github.com/bnema/vev/internal/domain" | |
| 15 | 16 | "github.com/bnema/vev/internal/ports" | |
| 16 | 17 | ) | |
| 17 | 18 | ||
| @@ -120,7 +121,7 @@ func TestTransportRoundTripAndVersionMismatchFrame(t *testing.T) { | |||
| 120 | 121 | defer func() { _ = client.Close() }() | |
| 121 | 122 | defer func() { _ = server.Close() }() | |
| 122 | 123 | ||
| 123 | - | hello := ports.Hello{Version: ports.ProtocolVersion + 1, Intent: ports.IntentAttach, Name: "work"} | |
| 124 | + | hello := ports.Hello{Version: ports.ProtocolVersion + 1, Intent: ports.IntentAttach, Name: "work", Size: domain.Size{Cols: 80, Rows: 24}} | |
| 124 | 125 | go func() { | |
| 125 | 126 | f, err := server.Recv() | |
| 126 | 127 | if err != nil { | |
| @@ -12,6 +12,7 @@ import ( | |||||
| 12 | "testing" | 12 | "testing" | ||
| 13 | "time" | 13 | "time" | ||
| 14 | 14 | ||||
| 15 | + | "github.com/bnema/vev/internal/domain" | |||
| 15 | "github.com/bnema/vev/internal/ports" | 16 | "github.com/bnema/vev/internal/ports" | ||
| 16 | ) | 17 | ) | ||
| 17 | 18 | ||||
| @@ -120,7 +121,7 @@ func TestTransportRoundTripAndVersionMismatchFrame(t *testing.T) { | |||||
| 120 | defer func() { _ = client.Close() }() | 121 | defer func() { _ = client.Close() }() | ||
| 121 | defer func() { _ = server.Close() }() | 122 | defer func() { _ = server.Close() }() | ||
| 122 | 123 | ||||
| 123 | - | hello := ports.Hello{Version: ports.ProtocolVersion + 1, Intent: ports.IntentAttach, Name: "work"} | 124 | + | hello := ports.Hello{Version: ports.ProtocolVersion + 1, Intent: ports.IntentAttach, Name: "work", Size: domain.Size{Cols: 80, Rows: 24}} |
| 124 | go func() { | 125 | go func() { | ||
| 125 | f, err := server.Recv() | 126 | f, err := server.Recv() | ||
| 126 | if err != nil { | 127 | if err != nil { | ||