Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestCompareBytes (0.18 sec)

  1. src/bytes/compare_test.go

    func TestCompareIdenticalSlice(t *testing.T) {
    	var b = []byte("Hello Gophers!")
    	if Compare(b, b) != 0 {
    		t.Error("b != b")
    	}
    	if Compare(b, b[:1]) != 1 {
    		t.Error("b > b[:1] failed")
    	}
    }
    
    func TestCompareBytes(t *testing.T) {
    	lengths := make([]int, 0) // lengths to test in ascending order
    	for i := 0; i <= 128; i++ {
    		lengths = append(lengths, i)
    	}
    	lengths = append(lengths, 256, 512, 1024, 1333, 4095, 4096, 4097)
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Jul 13 23:11:42 GMT 2023
    - 6.8K bytes
    - Viewed (0)
Back to top