Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for testslice3 (0.18 sec)

  1. test/range.go

    	}
    }
    
    func main() {
    	testblankvars()
    	testchan()
    	testarray()
    	testarray1()
    	testarray2()
    	testarrayptr()
    	testarrayptr1()
    	testarrayptr2()
    	testslice()
    	testslice1()
    	testslice2()
    	testslice3()
    	teststring()
    	teststring1()
    	teststring2()
    	testmap()
    	testmap1()
    	testmap2()
    	testcalls()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 05:50:54 UTC 2017
    - 8.1K bytes
    - Viewed (0)
  2. operator/pkg/util/reflect_test.go

    	}
    }
    
    func TestIsValueFuncs(t *testing.T) {
    	testInt := int(42)
    	testStruct := struct{}{}
    	testSlice := []bool{}
    	testMap := map[bool]bool{}
    	var testNilSlice []bool
    	var testNilMap map[bool]bool
    
    	allValues := []any{nil, testInt, &testInt, testStruct, &testStruct, testNilSlice, testSlice, &testSlice, testNilMap, testMap, &testMap}
    
    	tests := []struct {
    		desc     string
    		function func(v reflect.Value) bool
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 10.2K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/test/testdata/compound_test.go

    	}
    }
    
    func slice_ssa(a, b []byte, x bool) []byte {
    	var s []byte
    	if x {
    		s = a
    	} else {
    		s = b
    	}
    	return s
    }
    
    func testSlice(t *testing.T) {
    	a := []byte{3, 4, 5}
    	b := []byte{7, 8, 9}
    	if want, got := byte(3), slice_ssa(a, b, true)[0]; got != want {
    		t.Errorf("slice_ssa(%v, %v, true) = %v, want %v\n", a, b, got, want)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 23 06:40:04 UTC 2020
    - 2.7K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/test/testdata/slice_test.go

    // either the slice pointer or the capacity.
    // See issue #14855.
    
    package main
    
    import "testing"
    
    const N = 1000000
    
    type X struct {
    	s []int
    }
    
    func TestSlice(t *testing.T) {
    	done := make(chan struct{})
    	a := make([]int, N+10)
    
    	x := &X{a}
    
    	go func() {
    		for i := 0; i < N; i++ {
    			x.s = x.s[1:9]
    		}
    		done <- struct{}{}
    	}()
    	go func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 23 06:40:04 UTC 2020
    - 850 bytes
    - Viewed (0)
  5. src/net/splice_linux_test.go

    	"os"
    	"strconv"
    	"sync"
    	"syscall"
    	"testing"
    )
    
    func TestSplice(t *testing.T) {
    	t.Run("tcp-to-tcp", func(t *testing.T) { testSplice(t, "tcp", "tcp") })
    	if !testableNetwork("unixgram") {
    		t.Skip("skipping unix-to-tcp tests")
    	}
    	t.Run("unix-to-tcp", func(t *testing.T) { testSplice(t, "unix", "tcp") })
    	t.Run("tcp-to-unix", func(t *testing.T) { testSplice(t, "tcp", "unix") })
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 21:49:26 UTC 2024
    - 14.5K bytes
    - Viewed (0)
  6. test/rangegen.go

    					code1 := gen(b, "testSlice"+s, "_, ", "slice2", i, double, func(c int) bool { return c == j || c == k })
    					if code0 != code1 {
    						panic("bad generator")
    					}
    					tests += "test" + s + "()\n"
    					p(b, testCode, "test"+s, []int{j, k}, "testFunc"+s, "testSlice"+s)
    					flush(false)
    				}
    			}
    		}
    	}
    	for i := 1; i <= max; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 23:35:19 UTC 2023
    - 8.4K bytes
    - Viewed (0)
  7. src/reflect/all_test.go

    	ptr2 := rv.UnsafePointer()
    	rv = rv.Slice(5, 5)
    	ptr3 := rv.UnsafePointer()
    	if ptr3 != ptr2 {
    		t.Errorf("xs.Slice(3,4).Slice3(5,5).UnsafePointer() = %p, want %p", ptr3, ptr2)
    	}
    }
    
    func TestSlice3(t *testing.T) {
    	xs := []int{1, 2, 3, 4, 5, 6, 7, 8}
    	v := ValueOf(xs).Slice3(3, 5, 7).Interface().([]int)
    	if len(v) != 2 {
    		t.Errorf("len(xs.Slice3(3, 5, 7)) = %d", len(v))
    	}
    	if cap(v) != 4 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
  8. src/encoding/gob/encoder_test.go

    var testFloat32 float32
    var testString string
    var testSlice []string
    var testMap map[string]int
    var testArray [7]int
    
    type SingleTest struct {
    	in  any
    	out any
    	err string
    }
    
    var singleTests = []SingleTest{
    	{17, &testInt, ""},
    	{float32(17.5), &testFloat32, ""},
    	{"bike shed", &testString, ""},
    	{[]string{"bike", "shed", "paint", "color"}, &testSlice, ""},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 29.7K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/io/ByteSourceTest.java

        byte[] copy = bytes.clone();
        copy[9876] = 1;
        ByteSource oneByteOff = new TestByteSource(copy);
        assertFalse(source.contentEquals(oneByteOff));
      }
    
      public void testSlice() throws IOException {
        // Test preconditions
        assertThrows(IllegalArgumentException.class, () -> source.slice(-1, 10));
    
        assertThrows(IllegalArgumentException.class, () -> source.slice(0, -1));
    
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue May 07 15:26:58 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  10. src/sort/sort_test.go

    	}
    }
    
    func TestStrings(t *testing.T) {
    	data := strings
    	Strings(data[0:])
    	if !StringsAreSorted(data[0:]) {
    		t.Errorf("sorted %v", strings)
    		t.Errorf("   got %v", data)
    	}
    }
    
    func TestSlice(t *testing.T) {
    	data := strings
    	Slice(data[:], func(i, j int) bool {
    		return data[i] < data[j]
    	})
    	if !SliceIsSorted(data[:], func(i, j int) bool { return data[i] < data[j] }) {
    		t.Errorf("sorted %v", strings)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 19:41:04 UTC 2024
    - 16.9K bytes
    - Viewed (0)
Back to top