test: fix TestTunneler_Integration line endings on Windows (#25584)

fixes https://github.com/coder/internal/issues/1542

Drop line endings before test assertion to make it more cross-platform.
This commit is contained in:
Spike Curtis
2026-05-21 12:26:54 -04:00
committed by GitHub
parent 5c4d2c29da
commit 9998c7499c
@@ -3,6 +3,7 @@ package tunneler_test
import (
"bytes"
"context"
"strings"
"testing"
"github.com/stretchr/testify/require"
@@ -58,7 +59,8 @@ func TestTunneler_Integration(t *testing.T) {
defer testAgent.Close()
testutil.TryReceive(ctx, t, app.done)
require.Equal(t, app.result, "foo\n")
// TrimSpace removes line endings, which vary by OS and are not important to this test.
require.Equal(t, "foo", strings.TrimSpace(app.result))
err := tun.GracefulShutdown(ctx)
require.NoError(t, err)