Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for StringFind (0.48 sec)

  1. src/strings/search_test.go

    		{"abc", "acca", -1},
    		{"aa", "aaa", 0},
    		{"baa", "aaaaa", -1},
    		{"at that", "which finally halts.  at that point", 22},
    	}
    
    	for _, tc := range testCases {
    		got := StringFind(tc.pat, tc.text)
    		want := tc.index
    		if got != want {
    			t.Errorf("stringFind(%q, %q) got %d, want %d\n", tc.pat, tc.text, got, want)
    		}
    	}
    }
    
    func TestFinderCreation(t *testing.T) {
    	testCases := []struct {
    		pattern string
    		bad     [256]int
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 01 21:52:00 UTC 2018
    - 1.9K bytes
    - Viewed (0)
  2. src/strings/export_test.go

    			if int(m) != r.tableSize && t.table[m] != nil {
    				s += Repeat(".", depth) + string([]byte{byte(b)})
    				s += r.printNode(t.table[m], depth+1)
    			}
    		}
    	}
    	return
    }
    
    func StringFind(pattern, text string) int {
    	return makeStringFinder(pattern).next(text)
    }
    
    func DumpTables(pattern string) ([]int, []int) {
    	finder := makeStringFinder(pattern)
    	return finder.badCharSkip[:], finder.goodSuffixSkip
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 1.1K bytes
    - Viewed (0)
  3. src/text/template/funcs.go

    	errNoComparison      = errors.New("missing argument for comparison")
    )
    
    type kind int
    
    const (
    	invalidKind kind = iota
    	boolKind
    	complexKind
    	intKind
    	floatKind
    	stringKind
    	uintKind
    )
    
    func basicKind(v reflect.Value) (kind, error) {
    	switch v.Kind() {
    	case reflect.Bool:
    		return boolKind, nil
    	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 22:23:55 UTC 2024
    - 20.9K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/cel/library/cost.go

    			// of estimating the additional comparison cost.
    			if elNode := l.listElementNode(*target); elNode != nil {
    				k := elNode.Type().Kind()
    				if k == types.StringKind || k == types.BytesKind {
    					sz := l.sizeEstimate(elNode)
    					elCost = elCost.Add(sz.MultiplyByCostFactor(common.StringTraversalCostFactor))
    				}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Apr 23 17:22:44 UTC 2024
    - 20.6K bytes
    - Viewed (0)
  5. src/encoding/json/decode_test.go

    	return errors.New("MustNotUnmarshalText was used")
    }
    
    func TestStringKind(t *testing.T) {
    	type stringKind string
    	want := map[stringKind]int{"foo": 42}
    	data, err := Marshal(want)
    	if err != nil {
    		t.Fatalf("Marshal error: %v", err)
    	}
    	var got map[stringKind]int
    	err = Unmarshal(data, &got)
    	if err != nil {
    		t.Fatalf("Unmarshal error: %v", err)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 11 16:40:14 UTC 2024
    - 67.6K bytes
    - Viewed (0)
Back to top