Skip to content

Unexpected result with PrefixSuffix.Match #51

@Chrstm

Description

@Chrstm

The PrefixSuffix.Match doesn't consider the condition that the prefix overlaps with the suffix.
version: v0.2.3
POC:

func main() {
	g, _ := glob.Compile("a*ant")
	fmt.Println(g.Match("an ant")) // true EXPECTED
	fmt.Println(g.Match("ant"))    // true UNEXPECTED

	g, _ = glob.Compile("br*r")
	fmt.Println(g.Match("brother")) // true EXPECTED
	fmt.Println(g.Match("br"))      // true UNEXPECTED

	g, _ = glob.Compile("so*so")
	fmt.Println(g.Match("so so")) // true EXPECTED
	fmt.Println(g.Match("so"))    // true UNEXPECTED
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions