mirror of https://github.com/golang/go.git
Compare commits
6 Commits
ea8eb0aee6
...
b131528f36
| Author | SHA1 | Date |
|---|---|---|
|
|
b131528f36 | |
|
|
49cdf0c42e | |
|
|
3bf1eecbd3 | |
|
|
8ed23a2936 | |
|
|
ef60769b46 | |
|
|
5594631279 |
|
|
@ -82,7 +82,7 @@ func newGCM(cipher Block, nonceSize, tagSize int) (AEAD, error) {
|
||||||
|
|
||||||
// NewGCMWithRandomNonce returns the given cipher wrapped in Galois Counter
|
// NewGCMWithRandomNonce returns the given cipher wrapped in Galois Counter
|
||||||
// Mode, with randomly-generated nonces. The cipher must have been created by
|
// Mode, with randomly-generated nonces. The cipher must have been created by
|
||||||
// [aes.NewCipher].
|
// [crypto/aes.NewCipher].
|
||||||
//
|
//
|
||||||
// It generates a random 96-bit nonce, which is prepended to the ciphertext by Seal,
|
// It generates a random 96-bit nonce, which is prepended to the ciphertext by Seal,
|
||||||
// and is extracted from the ciphertext by Open. The NonceSize of the AEAD is zero,
|
// and is extracted from the ciphertext by Open. The NonceSize of the AEAD is zero,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
//
|
||||||
|
PACKAGE issue62640
|
||||||
|
|
||||||
|
IMPORTPATH
|
||||||
|
testdata/issue62640
|
||||||
|
|
||||||
|
FILENAMES
|
||||||
|
testdata/issue62640.go
|
||||||
|
|
||||||
|
TYPES
|
||||||
|
//
|
||||||
|
type E struct{}
|
||||||
|
|
||||||
|
// F should be hidden within S because of the S.F field.
|
||||||
|
func (E) F()
|
||||||
|
|
||||||
|
//
|
||||||
|
type S struct {
|
||||||
|
E
|
||||||
|
F int
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
//
|
||||||
|
PACKAGE issue62640
|
||||||
|
|
||||||
|
IMPORTPATH
|
||||||
|
testdata/issue62640
|
||||||
|
|
||||||
|
FILENAMES
|
||||||
|
testdata/issue62640.go
|
||||||
|
|
||||||
|
TYPES
|
||||||
|
//
|
||||||
|
type E struct{}
|
||||||
|
|
||||||
|
// F should be hidden within S because of the S.F field.
|
||||||
|
func (E) F()
|
||||||
|
|
||||||
|
//
|
||||||
|
type S struct {
|
||||||
|
E
|
||||||
|
F int
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
//
|
||||||
|
PACKAGE issue62640
|
||||||
|
|
||||||
|
IMPORTPATH
|
||||||
|
testdata/issue62640
|
||||||
|
|
||||||
|
FILENAMES
|
||||||
|
testdata/issue62640.go
|
||||||
|
|
||||||
|
TYPES
|
||||||
|
//
|
||||||
|
type E struct{}
|
||||||
|
|
||||||
|
// F should be hidden within S because of the S.F field.
|
||||||
|
func (E) F()
|
||||||
|
|
||||||
|
//
|
||||||
|
type S struct {
|
||||||
|
E
|
||||||
|
F int
|
||||||
|
}
|
||||||
|
|
||||||
|
// F should be hidden within S because of the S.F field.
|
||||||
|
func (S) F()
|
||||||
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright 2025 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.
|
||||||
|
|
||||||
|
package issue62640
|
||||||
|
|
||||||
|
type E struct{}
|
||||||
|
|
||||||
|
// F should be hidden within S because of the S.F field.
|
||||||
|
func (E) F() {}
|
||||||
|
|
||||||
|
type S struct {
|
||||||
|
E
|
||||||
|
F int
|
||||||
|
}
|
||||||
|
|
@ -312,8 +312,10 @@ type heapArena struct {
|
||||||
// during marking.
|
// during marking.
|
||||||
pageSpecials [pagesPerArena / 8]uint8
|
pageSpecials [pagesPerArena / 8]uint8
|
||||||
|
|
||||||
// pageUseSpanDartboard is a bitmap that indicates which spans are
|
// pageUseSpanInlineMarkBits is a bitmap where each bit corresponds
|
||||||
// heap spans and also gcUsesSpanDartboard.
|
// to a span, as only spans one page in size can have inline mark bits.
|
||||||
|
// The bit indicates that the span has a spanInlineMarkBits struct
|
||||||
|
// stored directly at the top end of the span's memory.
|
||||||
pageUseSpanInlineMarkBits [pagesPerArena / 8]uint8
|
pageUseSpanInlineMarkBits [pagesPerArena / 8]uint8
|
||||||
|
|
||||||
// checkmarks stores the debug.gccheckmark state. It is only
|
// checkmarks stores the debug.gccheckmark state. It is only
|
||||||
|
|
|
||||||
|
|
@ -21,15 +21,14 @@ type Interface interface {
|
||||||
// Less reports whether the element with index i
|
// Less reports whether the element with index i
|
||||||
// must sort before the element with index j.
|
// must sort before the element with index j.
|
||||||
//
|
//
|
||||||
|
// Less must satisfy strict weak ordering.
|
||||||
|
// https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings
|
||||||
|
//
|
||||||
// If both Less(i, j) and Less(j, i) are false,
|
// If both Less(i, j) and Less(j, i) are false,
|
||||||
// then the elements at index i and j are considered equal.
|
// then the elements at index i and j are considered equal.
|
||||||
// Sort may place equal elements in any order in the final result,
|
// Sort may place equal elements in any order in the final result,
|
||||||
// while Stable preserves the original input order of equal elements.
|
// while Stable preserves the original input order of equal elements.
|
||||||
//
|
//
|
||||||
// Less must describe a transitive ordering:
|
|
||||||
// - if both Less(i, j) and Less(j, k) are true, then Less(i, k) must be true as well.
|
|
||||||
// - if both Less(i, j) and Less(j, k) are false, then Less(i, k) must be false as well.
|
|
||||||
//
|
|
||||||
// Note that floating-point comparison (the < operator on float32 or float64 values)
|
// Note that floating-point comparison (the < operator on float32 or float64 values)
|
||||||
// is not a transitive ordering when not-a-number (NaN) values are involved.
|
// is not a transitive ordering when not-a-number (NaN) values are involved.
|
||||||
// See Float64Slice.Less for a correct implementation for floating-point values.
|
// See Float64Slice.Less for a correct implementation for floating-point values.
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright 2025 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.
|
||||||
|
|
||||||
|
package synctest_test
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
// helperLog is a t.Helper which logs.
|
||||||
|
// Since it is a helper, the log prefix should contain
|
||||||
|
// the caller's file, not helper_test.go.
|
||||||
|
func helperLog(t *testing.T, s string) {
|
||||||
|
t.Helper()
|
||||||
|
t.Log(s)
|
||||||
|
}
|
||||||
|
|
@ -140,6 +140,18 @@ func TestRun(t *testing.T) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestHelper(t *testing.T) {
|
||||||
|
runTest(t, []string{"-test.v"}, func() {
|
||||||
|
synctest.Test(t, func(t *testing.T) {
|
||||||
|
helperLog(t, "log in helper")
|
||||||
|
})
|
||||||
|
}, `^=== RUN TestHelper
|
||||||
|
synctest_test.go:.* log in helper
|
||||||
|
--- PASS: TestHelper.*
|
||||||
|
PASS
|
||||||
|
$`)
|
||||||
|
}
|
||||||
|
|
||||||
func wantPanic(t *testing.T, want string) {
|
func wantPanic(t *testing.T, want string) {
|
||||||
if e := recover(); e != nil {
|
if e := recover(); e != nil {
|
||||||
if got := fmt.Sprint(e); got != want {
|
if got := fmt.Sprint(e); got != want {
|
||||||
|
|
|
||||||
|
|
@ -1261,6 +1261,9 @@ func (c *common) Skipped() bool {
|
||||||
// When printing file and line information, that function will be skipped.
|
// When printing file and line information, that function will be skipped.
|
||||||
// Helper may be called simultaneously from multiple goroutines.
|
// Helper may be called simultaneously from multiple goroutines.
|
||||||
func (c *common) Helper() {
|
func (c *common) Helper() {
|
||||||
|
if c.isSynctest {
|
||||||
|
c = c.parent
|
||||||
|
}
|
||||||
c.mu.Lock()
|
c.mu.Lock()
|
||||||
defer c.mu.Unlock()
|
defer c.mu.Unlock()
|
||||||
if c.helperPCs == nil {
|
if c.helperPCs == nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue