- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 64 for NewMatcher (0.28 sec)
-
pkg/test/framework/resource/matcher.go
type testFilter []*regexp.Regexp type Matcher struct { filters []testFilter } // NewMatcher reimplements the logic of Go's -test.run. The code is mostly directly copied from Go's source. func NewMatcher(regexs []string) (*Matcher, error) { filters := []testFilter{} for _, regex := range regexs { filter := splitRegexp(regex) for i, s := range filter {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Fri Feb 12 23:30:37 UTC 2021 - 3.2K bytes - Viewed (0) -
src/cmd/go/testdata/mod/golang.org_x_text_v0.0.0-20170915032832-14c0d48ead0c.txt
package language import "strings" type Tag string func Make(s string) Tag { return Tag(s) } func (t Tag) String() string { return string(t) } func NewMatcher(tags []Tag) Matcher { return &matcher{tags} } type Matcher interface { Match(...Tag) (Tag, int, int) } type matcher struct { tags []Tag } func (m *matcher) Match(prefs ...Tag) (Tag, int, int) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Aug 10 00:47:13 UTC 2018 - 1.2K bytes - Viewed (0) -
src/cmd/go/testdata/mod/golang.org_x_text_v0.3.0.txt
package language import "strings" type Tag string func Make(s string) Tag { return Tag(s) } func (t Tag) String() string { return string(t) } func NewMatcher(tags []Tag) Matcher { return &matcher{tags} } type Matcher interface { Match(...Tag) (Tag, int, int) } type matcher struct { tags []Tag } func (m *matcher) Match(prefs ...Tag) (Tag, int, int) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Aug 10 00:47:13 UTC 2018 - 1.1K bytes - Viewed (0) -
pkg/test/framework/resource/matcher_test.go
nomatches: []string{"TestFoo/something/subset", "TestFoo/something", "TestFoo", "TestFoo/TestBar"}, }, } for _, tt := range cases { t.Run(tt.name, func(t *testing.T) { matcher, err := NewMatcher(tt.input) if err != nil { t.Fatal(err) } for _, m := range tt.matches { got := matcher.MatchTest(m) if !got { t.Errorf("expected match for %q", m) } }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Fri Feb 12 23:30:37 UTC 2021 - 2.3K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/matching/matching.go
objectMatcher *object.Matcher } func (m *Matcher) GetNamespace(name string) (*corev1.Namespace, error) { return m.namespaceMatcher.GetNamespace(name) } // NewMatcher initialize the matcher with dependencies requires func NewMatcher( namespaceLister listersv1.NamespaceLister, client kubernetes.Interface, ) *Matcher { return &Matcher{ namespaceMatcher: &namespace.Matcher{ NamespaceLister: namespaceLister,
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Mar 06 00:00:21 UTC 2024 - 6.8K bytes - Viewed (0) -
src/testing/match_test.go
{"//foo", "", "TestFoo", "bar/baz", false, false}, {"/bar/baz", "", "TestFoo", "x", false, false}, {"/bar/baz", "", "TestBar", "x/bar/baz", false, false}, } for _, tc := range testCases { m := newMatcher(regexp.MatchString, tc.pattern, "-test.run", tc.skip) parent := &common{name: tc.parent} if tc.parent != "" { parent.level = 1 }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 16 14:48:54 UTC 2022 - 8K bytes - Viewed (0) -
src/testing/example.go
_, ok = runExamples(matchString, examples) return ok } func runExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ran, ok bool) { ok = true m := newMatcher(matchString, *match, "-test.run", *skip) var eg InternalExample for _, eg = range examples { _, matched, _ := m.fullName(nil, eg.Name) if !matched { continue } ran = true if !runExample(eg) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 2.8K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/text/language/match.go
// to being able to comprehend the written form of an alternative language. func Comprehends(speaker, alternative Tag) Confidence { _, _, c := NewMatcher([]Tag{alternative}).Match(speaker) return c } // NewMatcher returns a Matcher that matches an ordered list of preferred tags // against a list of supported tags based on written intelligibility, closeness
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jan 24 13:01:26 UTC 2024 - 25.1K bytes - Viewed (0) -
src/testing/match.go
// TODO: fix test_main to avoid race and improve caching, also allowing to // eliminate this Mutex. var matchMutex sync.Mutex func allMatcher() *matcher { return newMatcher(nil, "", "", "") } func newMatcher(matchString func(pat, str string) (bool, error), patterns, name, skips string) *matcher { var filter, skip filterMatch if patterns == "" { filter = simpleMatch{} // always partial true } else {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jul 27 22:07:13 UTC 2023 - 7.7K bytes - Viewed (0) -
src/cmd/go/testdata/mod/rsc.io_sampler_v1.99.99.txt
} f := strings.Split(line, ": ") if len(f) != 3 { continue } tag := language.Make(f[1]) tags = append(tags, tag) t.byTag[tag.String()] = f[2] } t.matcher = language.NewMatcher(tags) return t } // find finds the text to use for the given language tag preferences. func (t *text) find(prefs []language.Tag) string { tag, _, _ := t.matcher.Match(prefs...) s := t.byTag[tag.String()]
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jul 12 20:46:50 UTC 2018 - 3.2K bytes - Viewed (0)