Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 3 of 3 for FieldsFunc (0.07 seconds)

  1. src/bytes/bytes_test.go

    			}
    		}
    	}
    }
    
    func TestFieldsFunc(t *testing.T) {
    	for _, tt := range fieldstests {
    		a := FieldsFunc([]byte(tt.s), unicode.IsSpace)
    		result := sliceOfString(a)
    		if !slices.Equal(result, tt.a) {
    			t.Errorf("FieldsFunc(%q, unicode.IsSpace) = %v; want %v", tt.s, a, tt.a)
    			continue
    		}
    	}
    	pred := func(c rune) bool { return c == 'X' }
    Created: Tue Apr 07 11:13:11 GMT 2026
    - Last Modified: Wed Mar 11 03:07:05 GMT 2026
    - 62.9K bytes
    - Click Count (0)
  2. src/bytes/bytes.go

    // non-empty. Unlike [Split], leading and trailing runs of code points
    // satisfying f(c) are discarded.
    //
    // FieldsFunc makes no guarantees about the order in which it calls f(c)
    // and assumes that f always returns the same value for a given c.
    func FieldsFunc(s []byte, f func(rune) bool) [][]byte {
    	// A span is used to record a slice of s of the form s[start:end].
    Created: Tue Apr 07 11:13:11 GMT 2026
    - Last Modified: Thu Mar 12 17:56:55 GMT 2026
    - 36.3K bytes
    - Click Count (0)
  3. utils/utils_test.go

    	"runtime"
    	"strings"
    	"testing"
    	"time"
    )
    
    func TestIsInvalidDBNameChar(t *testing.T) {
    	for _, db := range []string{"db", "dbName", "db_name", "db1", "1dbname", "db$name"} {
    		if fields := strings.FieldsFunc(db, IsInvalidDBNameChar); len(fields) != 1 {
    			t.Fatalf("failed to parse db name %v", db)
    		}
    	}
    }
    
    func TestCheckTruth(t *testing.T) {
    	checkTruthTests := []struct {
    		v   string
    		out bool
    	}{
    Created: Sun Apr 05 09:35:12 GMT 2026
    - Last Modified: Sat Mar 21 11:31:30 GMT 2026
    - 5.5K bytes
    - Click Count (0)
Back to Top