Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for testContains (0.25 sec)

  1. utils/utils_test.go

    	}
    	for _, c := range cases {
    		if key := ToStringKey(c.values...); key != c.key {
    			t.Errorf("%v: expected %v, got %v", c.values, c.key, key)
    		}
    	}
    }
    
    func TestContains(t *testing.T) {
    	containsTests := []struct {
    		name  string
    		elems []string
    		elem  string
    		out   bool
    	}{
    		{"exists", []string{"1", "2", "3"}, "1", true},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Feb 19 03:42:25 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  2. src/bytes/bytes_test.go

    }{
    	{[]byte("hello"), []byte("hel"), true},
    	{[]byte("日本語"), []byte("日本"), true},
    	{[]byte("hello"), []byte("Hello, world"), false},
    	{[]byte("東京"), []byte("京東"), false},
    }
    
    func TestContains(t *testing.T) {
    	for _, tt := range containsTests {
    		if got := Contains(tt.b, tt.subslice); got != tt.want {
    			t.Errorf("Contains(%q, %q) = %v, want %v", tt.b, tt.subslice, got, tt.want)
    		}
    	}
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Jan 24 16:07:25 GMT 2024
    - 56.2K bytes
    - Viewed (0)
Back to top