From c2568b104369bcf5c4d42c6281d235a52bb9675f Mon Sep 17 00:00:00 2001 From: Zxilly Date: Wed, 17 Jul 2024 13:31:44 +0800 Subject: [PATCH] limit test to wasm --- src/bytes/bytes_js_wasm_test.go | 21 +++++++++++++++++++++ src/bytes/bytes_test.go | 9 --------- 2 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 src/bytes/bytes_js_wasm_test.go diff --git a/src/bytes/bytes_js_wasm_test.go b/src/bytes/bytes_js_wasm_test.go new file mode 100644 index 0000000000..ad9db34318 --- /dev/null +++ b/src/bytes/bytes_js_wasm_test.go @@ -0,0 +1,21 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build js && wasm + +package bytes_test + +import ( + "bytes" + "testing" +) + +func TestIssue65571(t *testing.T) { + b := make([]byte, 1<<31+1) + b[1<<31] = 1 + i := bytes.IndexByte(b, 1) + if i != 1<<31 { + t.Errorf("IndexByte(b, 1) = %d; want %d", i, 1<<31) + } +} diff --git a/src/bytes/bytes_test.go b/src/bytes/bytes_test.go index 1ece1d5d50..200a357bc0 100644 --- a/src/bytes/bytes_test.go +++ b/src/bytes/bytes_test.go @@ -2278,12 +2278,3 @@ func TestClone(t *testing.T) { } } } - -func TestIssue65571(t *testing.T) { - b := make([]byte, 1<<31+1) - b[1<<31] = 1 - i := IndexByte(b, 1) - if i != 1<<31 { - t.Errorf("IndexByte(b, 1) = %d; want %d", i, 1<<31) - } -}