Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for mustParsePattern (0.18 sec)

  1. src/net/http/pattern_test.go

    		{"POST /", "POST /", equivalent},
    		{"GET /", "POST /", disjoint},
    		{"GET /", "/", moreSpecific},
    		{"HEAD /", "/", moreSpecific},
    		{"GET /", "HEAD /", moreGeneral},
    	} {
    		pat1 := mustParsePattern(t, test.p1)
    		pat2 := mustParsePattern(t, test.p2)
    		got := pat1.compareMethods(pat2)
    		if got != test.want {
    			t.Errorf("%s vs %s: got %s, want %s", test.p1, test.p2, got, test.want)
    		}
    		got2 := pat2.compareMethods(pat1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 16:36:30 UTC 2024
    - 15K bytes
    - Viewed (0)
  2. src/net/http/routing_index_test.go

    	}
    }
    
    func BenchmarkMultiConflicts(b *testing.B) {
    	// How fast is indexing if the corpus is all multis?
    	const nMultis = 1000
    	var pats []*pattern
    	for i := 0; i < nMultis; i++ {
    		pats = append(pats, mustParsePattern(b, fmt.Sprintf("/a/b/{x}/d%d/", i)))
    	}
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		var idx routingIndex
    		for _, p := range pats {
    			got := indexConflicts(p, &idx)
    			if len(got) != 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 22:14:00 UTC 2024
    - 4K bytes
    - Viewed (0)
  3. src/net/http/server_test.go

    		{"/a/{x}", "/a/b", true},
    		{"/a/b/", "/a/b/", true},
    		{"/a/b/{$}", "/a/b/", true},
    		{"/a/", "/a/b/", false},
    	} {
    		var n *routingNode
    		if test.pattern != "" {
    			pat := mustParsePattern(t, test.pattern)
    			n = &routingNode{pattern: pat}
    		}
    		got := exactMatch(n, test.path)
    		if got != test.want {
    			t.Errorf("%q, %s: got %t, want %t", test.pattern, test.path, got, test.want)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 13 13:54:22 UTC 2024
    - 7.3K bytes
    - Viewed (0)
Back to top