Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for TestTrim (0.1 sec)

  1. src/cmd/doc/doc_test.go

    	{"/usr/gopher/bar", "/usr/gopher", "bar", true},
    	{"/usr/gopherflakes", "/usr/gopher", "/usr/gopherflakes", false},
    	{"/usr/gopher/bar", "/usr/zot", "/usr/gopher/bar", false},
    }
    
    func TestTrim(t *testing.T) {
    	for _, test := range trimTests {
    		result, ok := trim(test.path, test.prefix)
    		if ok != test.ok {
    			t.Errorf("%s %s expected %t got %t", test.path, test.prefix, test.ok, ok)
    			continue
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 07 19:16:55 UTC 2023
    - 31.2K bytes
    - Viewed (0)
  2. src/strings/strings_test.go

    	{"TrimRight", "☺\xc0", "☺", "☺\xc0"},
    	{"TrimPrefix", "aabb", "a", "abb"},
    	{"TrimPrefix", "aabb", "b", "aabb"},
    	{"TrimSuffix", "aabb", "a", "aabb"},
    	{"TrimSuffix", "aabb", "b", "aab"},
    }
    
    func TestTrim(t *testing.T) {
    	for _, tc := range trimTests {
    		name := tc.f
    		var f func(string, string) string
    		switch name {
    		case "Trim":
    			f = Trim
    		case "TrimLeft":
    			f = TrimLeft
    		case "TrimRight":
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 12:58:37 UTC 2024
    - 53K bytes
    - Viewed (0)
  3. src/bytes/bytes_test.go

    	{"TrimSuffix", nil, "", nil},
    	{"TrimSuffix", []byte{}, "", []byte{}},
    	{"TrimSuffix", []byte{'a'}, "a", []byte{}},
    	{"TrimSuffix", []byte("☺"), "☺", []byte{}},
    }
    
    func TestTrim(t *testing.T) {
    	toFn := func(name string) (func([]byte, string) []byte, func([]byte, []byte) []byte) {
    		switch name {
    		case "Trim":
    			return Trim, nil
    		case "TrimLeft":
    			return TrimLeft, nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 12:58:37 UTC 2024
    - 56.5K bytes
    - Viewed (0)
Back to top