Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestIndexRune (0.11 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 Nov 05 11:13:11 UTC 2024
    - Last Modified: Mon Aug 19 19:09:04 UTC 2024
    - 61.2K bytes
    - Viewed (0)
Back to top