...

Source file src/bytes/bytes_js_wasm_test.go

Documentation: bytes

     1  // Copyright 2024 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build js && wasm
     6  
     7  package bytes_test
     8  
     9  import (
    10  	"bytes"
    11  	"testing"
    12  )
    13  
    14  func TestIssue65571(t *testing.T) {
    15  	b := make([]byte, 1<<31+1)
    16  	b[1<<31] = 1
    17  	i := bytes.IndexByte(b, 1)
    18  	if i != 1<<31 {
    19  		t.Errorf("IndexByte(b, 1) = %d; want %d", i, 1<<31)
    20  	}
    21  }
    22  

View as plain text