diff options
| author | Shulhan <ms@kilabit.info> | 2025-01-22 21:33:10 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2025-01-22 21:34:16 +0700 |
| commit | 360cd7bdc721c2aa968e2f6888db1c7e36538ae2 (patch) | |
| tree | 08c6610214a4da1b54707231c235e81127deeae6 /lib/websocket/frames_test.go | |
| parent | cdf43c8a97f6fbe7548aa45d3ce2680bdeb70e36 (diff) | |
| download | pakakeh.go-360cd7bdc721c2aa968e2f6888db1c7e36538ae2.tar.xz | |
lib/bytes: replace Copy and Concat with standard library
Since Go 1.20, the standard bytes package have the Copy function.
Since Go 1.22, the standard slices package have the Concat function.
Diffstat (limited to 'lib/websocket/frames_test.go')
| -rw-r--r-- | lib/websocket/frames_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/websocket/frames_test.go b/lib/websocket/frames_test.go index 5cd4a098..6753210d 100644 --- a/lib/websocket/frames_test.go +++ b/lib/websocket/frames_test.go @@ -1,13 +1,13 @@ -// Copyright 2019, Shulhan <ms@kilabit.info>. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// SPDX-FileCopyrightText: 2019 M. Shulhan <ms@kilabit.info> +// +// SPDX-License-Identifier: BSD-3-Clause package websocket import ( + "slices" "testing" - libbytes "git.sr.ht/~shulhan/pakakeh.go/lib/bytes" "git.sr.ht/~shulhan/pakakeh.go/lib/test" ) @@ -114,7 +114,7 @@ func TestFrameUnpack(t *testing.T) { }, }, { desc: `256 bytes binary message in a single unmasked frame`, - in: libbytes.Concat([]byte{0x82, 0x7E, 0x01, 0x00}, + in: slices.Concat([]byte{0x82, 0x7E, 0x01, 0x00}, _dummyPayload256), exp: &Frame{ fin: frameIsFinished, @@ -126,7 +126,7 @@ func TestFrameUnpack(t *testing.T) { }, }, { desc: `256 bytes binary message in a single masked frame`, - in: libbytes.Concat([]byte{ + in: slices.Concat([]byte{ 0x82, 0xFE, 0x01, 0x00, _testMaskKey[0], _testMaskKey[1], _testMaskKey[2], _testMaskKey[3], @@ -142,7 +142,7 @@ func TestFrameUnpack(t *testing.T) { }, }, { desc: `65536 binary message in a single unmasked frame`, - in: libbytes.Concat([]byte{ + in: slices.Concat([]byte{ 0x82, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, }, _dummyPayload65536), @@ -156,7 +156,7 @@ func TestFrameUnpack(t *testing.T) { }, }, { desc: `65536 binary message in a single masked frame`, - in: libbytes.Concat([]byte{ + in: slices.Concat([]byte{ 0x82, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, _testMaskKey[0], _testMaskKey[1], _testMaskKey[2], |
