Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestIndexRandom (0.25 sec)

  1. src/strings/strings_test.go

    		}
    	}
    }
    
    func simpleIndex(s, sep string) int {
    	n := len(sep)
    	for i := n; i <= len(s); i++ {
    		if s[i-n:i] == sep {
    			return i - n
    		}
    	}
    	return -1
    }
    
    func TestIndexRandom(t *testing.T) {
    	const chars = "abcdefghijklmnopqrstuvwxyz0123456789"
    	for times := 0; times < 10; times++ {
    		for strLen := 5 + rand.Intn(5); strLen < 140; strLen += 10 { // Arbitrary
    			s1 := make([]byte, strLen)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 12:58:37 UTC 2024
    - 53K bytes
    - Viewed (0)
Back to top