This repository was archived by the owner on Oct 13, 2021. It is now read-only.
Don't perform automatic wildcarding on searches.#104
Merged
erikrose merged 9 commits intomozilla:masterfrom Feb 21, 2013
Merged
Don't perform automatic wildcarding on searches.#104erikrose merged 9 commits intomozilla:masterfrom
erikrose merged 9 commits intomozilla:masterfrom
Conversation
added 4 commits
February 20, 2013 14:39
Previously a search like function:foo would find all functions that had "foo" anywhere in their name (like get_foo, set_foo, etc.). This made it hard to search for a function called exactly "foo" when there were many other functions containing that term. Now function:foo matches only functions called "foo". Wildcards can be specified with * and ? characters. For instance, function:*foo* matches the old behavior and returns all functions where "foo" appears somewhere in the name. Similarly, function:foo* matches functions that begin with "foo" and function:*foo matches functions that end with "foo". Using function:ba? searches for all functions that start with "ba" followed by exactly one more character so "bar" and "baz" match but "babar" does not.
dxr/testing.py
Outdated
Contributor
There was a problem hiding this comment.
I'm not sure this case is worth a dedicated helper method. It can be done in a one-liner like this:
eq_(self.search_results('void -"int"'), [])
What do you think? (And in any case, what's success_lines for?)
dxr/testing.py
Outdated
Contributor
There was a problem hiding this comment.
If we use eq_(..., []) here, we'll give a more informative error message, in that we'll actually show what unexpected results were returned.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously a search like function:foo would find all functions that had
"foo" anywhere in their name (like get_foo, set_foo, etc.). This made
it hard to search for a function called exactly "foo" when there were
many other functions containing that term.
Now function:foo matches only functions called "foo". Wildcards can be
specified with * and ? characters. For instance, function:foo matches
the old behavior and returns all functions where "foo" appears somewhere
in the name. Similarly, function:foo* matches functions that begin with
"foo" and function:*foo matches functions that end with "foo". Using
function:ba? searches for all functions that start with "ba" followed by
exactly one more character so "bar" and "baz" match but "babar" does not.
Open question: should things like function:* be disallowed?