Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for slicetest (0.15 sec)

  1. src/slices/slices_test.go

    // Copyright 2021 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 slices_test
    
    import (
    	"cmp"
    	"internal/race"
    	"internal/testenv"
    	"math"
    	. "slices"
    	"strings"
    	"testing"
    )
    
    var equalIntTests = []struct {
    	s1, s2 []int
    	want   bool
    }{
    	{
    		[]int{1},
    		nil,
    		false,
    	},
    	{
    		[]int{},
    		nil,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 13:32:06 UTC 2024
    - 33.2K bytes
    - Viewed (0)
  2. pkg/slices/slices_test.go

    John Howard <******@****.***> 1715384036 -0700
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 18.2K bytes
    - Viewed (0)
  3. src/slices/sort_benchmark_test.go

    // Copyright 2023 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 slices_test
    
    import (
    	"cmp"
    	"fmt"
    	"slices"
    	"strings"
    	"testing"
    )
    
    func BenchmarkBinarySearchFloats(b *testing.B) {
    	for _, size := range []int{16, 32, 64, 128, 512, 1024} {
    		b.Run(fmt.Sprintf("Size%d", size), func(b *testing.B) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 23:39:07 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  4. pkg/controller/endpointslice/endpointslice_controller_test.go

    	expectActions(t, client.Actions(), 1, "create", "endpointslices")
    
    	sliceList, err := client.DiscoveryV1().EndpointSlices(ns).List(context.TODO(), metav1.ListOptions{})
    	assert.Nil(t, err, "Expected no error fetching endpoint slices")
    	assert.Len(t, sliceList.Items, 1, "Expected 1 endpoint slices")
    	slice := sliceList.Items[0]
    	assert.Regexp(t, "^"+serviceName, slice.Name)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 08:33:32 UTC 2024
    - 65.5K bytes
    - Viewed (0)
  5. src/slices/iter_test.go

    // 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.
    
    package slices_test
    
    import (
    	"iter"
    	"math/rand/v2"
    	. "slices"
    	"testing"
    )
    
    func TestAll(t *testing.T) {
    	for size := 0; size < 10; size++ {
    		var s []int
    		for i := range size {
    			s = append(s, i)
    		}
    		ei, ev := 0, 0
    		cnt := 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 17:28:50 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  6. src/slices/example_test.go

    // Copyright 2023 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 slices_test
    
    import (
    	"cmp"
    	"fmt"
    	"slices"
    	"strconv"
    	"strings"
    )
    
    func ExampleBinarySearch() {
    	names := []string{"Alice", "Bob", "Vera"}
    	n, found := slices.BinarySearch(names, "Vera")
    	fmt.Println("Vera:", n, found)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 17:28:50 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  7. src/slices/sort_test.go

    // Copyright 2023 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 slices_test
    
    import (
    	"cmp"
    	"fmt"
    	"math"
    	"math/rand"
    	. "slices"
    	"strconv"
    	"strings"
    	"testing"
    )
    
    var ints = [...]int{74, 59, 238, -784, 9845, 959, 905, 0, 0, 42, 7586, -5467984, 7586}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 09 19:20:55 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  8. src/reflect/all_test.go

    	tests := []struct {
    		name     string
    		value    Value
    		testFunc func(v Value) bool
    	}{
    		{"map", ValueOf(m), mapTestFn},
    		{"slice no pointer", ValueOf([]int{1, 2, 3, 4, 5}), sliceTestFn},
    		{"slice has pointer", ValueOf(s), sliceTestFn},
    		{"non-map/slice", ValueOf(1), panicTestFn},
    	}
    
    	for _, tc := range tests {
    		tc := tc
    		t.Run(tc.name, func(t *testing.T) {
    			t.Parallel()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
Back to top