Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for splittests (0.16 sec)

  1. src/path/path_test.go

    		}
    	}
    }
    
    type SplitTest struct {
    	path, dir, file string
    }
    
    var splittests = []SplitTest{
    	{"a/b", "a/", "b"},
    	{"a/b/", "a/b/", ""},
    	{"a/", "a/", ""},
    	{"a", "", "a"},
    	{"/", "/", ""},
    }
    
    func TestSplit(t *testing.T) {
    	for _, test := range splittests {
    		if d, f := Split(test.path); d != test.dir || f != test.file {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 13 01:12:09 UTC 2020
    - 4.6K bytes
    - Viewed (0)
  2. src/cmd/go/internal/generate/generate_test.go

    	"os"
    	"path/filepath"
    	"reflect"
    	"runtime"
    	"testing"
    )
    
    type splitTest struct {
    	in  string
    	out []string
    }
    
    // Same as above, except including source line number to set
    type splitTestWithLine struct {
    	in         string
    	out        []string
    	lineNumber int
    }
    
    const anyLineNo = 0
    
    var splitTests = []splitTest{
    	{"", nil},
    	{"x", []string{"x"}},
    	{" a b\tc ", []string{"a", "b", "c"}},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 20 14:09:12 UTC 2022
    - 7.4K bytes
    - Viewed (0)
  3. src/path/filepath/path_test.go

    	{`\\host\share\`, `\\host\share\`, ``},
    	{`\\host\share\foo`, `\\host\share\`, `foo`},
    }
    
    func TestSplit(t *testing.T) {
    	var splittests []SplitTest
    	splittests = unixsplittests
    	if runtime.GOOS == "windows" {
    		splittests = append(splittests, winsplittests...)
    	}
    	for _, test := range splittests {
    		if d, f := filepath.Split(test.path); d != test.dir || f != test.file {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 22 16:38:19 UTC 2024
    - 47.1K bytes
    - Viewed (0)
  4. src/regexp/all_test.go

    			index := re.SubexpIndex(subexp.name)
    			if index != subexp.index {
    				t.Errorf("%q: SubexpIndex(%q) = %d, want %d", c.input, subexp.name, index, subexp.index)
    			}
    		}
    	}
    }
    
    var splitTests = []struct {
    	s   string
    	r   string
    	n   int
    	out []string
    }{
    	{"foo:and:bar", ":", -1, []string{"foo", "and", "bar"}},
    	{"foo:and:bar", ":", 1, []string{"foo:and:bar"}},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:36:03 UTC 2024
    - 25.8K bytes
    - Viewed (0)
  5. src/strings/strings_test.go

    		b.Fatalf("wrong index: expected 17, got=%d", got)
    	}
    	for i := 0; i < b.N; i++ {
    		IndexByte(benchmarkString, 'v')
    	}
    }
    
    type SplitTest struct {
    	s   string
    	sep string
    	n   int
    	a   []string
    }
    
    var splittests = []SplitTest{
    	{"", "", -1, []string{}},
    	{abcd, "", 2, []string{"a", "bcd"}},
    	{abcd, "", 4, []string{"a", "b", "c", "d"}},
    	{abcd, "", -1, []string{"a", "b", "c", "d"}},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 12:58:37 UTC 2024
    - 53K bytes
    - Viewed (0)
  6. src/bytes/bytes_test.go

    			if j != expect {
    				b.Fatal("bad count", j, expect)
    			}
    		}
    		for i := 0; i < len(buf); i++ {
    			buf[i] = 0
    		}
    	})
    }
    
    type SplitTest struct {
    	s   string
    	sep string
    	n   int
    	a   []string
    }
    
    var splittests = []SplitTest{
    	{"", "", -1, []string{}},
    	{abcd, "a", 0, nil},
    	{abcd, "", 2, []string{"a", "bcd"}},
    	{abcd, "a", -1, []string{"", "bcd"}},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 12:58:37 UTC 2024
    - 56.5K bytes
    - Viewed (0)
  7. src/cmd/cgo/internal/test/callback.go

    	for _, f := range splitTests {
    		f()
    	}
    }
    
    //export goStackCheck
    func goStackCheck() {
    	// use some stack memory to trigger split stack check
    	var buf [256]byte
    	use(buf[:])
    }
    
    var Used byte
    
    func use(buf []byte) {
    	for _, c := range buf {
    		Used += c
    	}
    }
    
    var splitTests = []func(){
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 12:00:02 UTC 2023
    - 111.5K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/fields/selector.go

    type TransformFunc func(field, value string) (newField, newValue string, err error)
    
    // splitTerms returns the comma-separated terms contained in the given fieldSelector.
    // Backslash-escaped commas are treated as data instead of delimiters, and are included in the returned terms, with the leading backslash preserved.
    func splitTerms(fieldSelector string) []string {
    	if len(fieldSelector) == 0 {
    		return nil
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 23 20:40:07 UTC 2020
    - 12.3K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/base/Splitter.java

     * }</pre>
     *
     * <p>For separator-based splitters that do not use {@code omitEmptyStrings}, an input string
     * containing {@code n} occurrences of the separator naturally yields an iterable of size {@code n +
     * 1}. So if the separator does not occur anywhere in the input, a single substring is returned
     * containing the entire input. Consequently, all splitters split the empty string to {@code [""]}
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Fri Feb 09 15:49:48 UTC 2024
    - 23.7K bytes
    - Viewed (0)
  10. guava/src/com/google/common/base/Splitter.java

     * }</pre>
     *
     * <p>For separator-based splitters that do not use {@code omitEmptyStrings}, an input string
     * containing {@code n} occurrences of the separator naturally yields an iterable of size {@code n +
     * 1}. So if the separator does not occur anywhere in the input, a single substring is returned
     * containing the entire input. Consequently, all splitters split the empty string to {@code [""]}
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 15 16:12:13 UTC 2024
    - 24.4K bytes
    - Viewed (0)
Back to top