Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestIndexRune (0.09 sec)

  1. src/bytes/bytes_test.go

    			p := IndexByte(b[i:i+15], byte(0))
    			if p != -1 {
    				t.Errorf("IndexByte(%q, %d) = %d", b[i:i+15], 0, p)
    			}
    		}
    		for j := 0; j < 15; j++ {
    			b[i+j] = 0
    		}
    	}
    }
    
    func TestIndexRune(t *testing.T) {
    	tests := []struct {
    		in   string
    		rune rune
    		want int
    	}{
    		{"", 'a', -1},
    		{"", '☺', -1},
    		{"foo", '☹', -1},
    		{"foo", 'o', 1},
    		{"foo☺bar", '☺', 3},
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Mon Jul 28 18:13:58 UTC 2025
    - 62.9K bytes
    - Viewed (0)
Back to top