Skip to content

Commit

Permalink
Fixed test case for explicit wildcard.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihxil committed Nov 26, 2024
1 parent c2b9a18 commit f326889
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,18 @@ public Optional<String> getWildcard() {
if (!isQuoted()) {
Boolean implicitWildcard = getImplicitWildcard();
if ((implicitWildcard != null && implicitWildcard) && !text.endsWith(" ")) {
// the last word will be implicitely converted to a wildcard. The assumption being that the user is still typing
// the last word will be implicitly converted to a wildcard. The assumption being that the user is still typing
String parsed = getParsedText();
List<String> split = Arrays.asList(parsed.trim().split("\\s+"));
var lastWord = split.getLast();
return Optional.of(lastWord + "*");
}
if (text.endsWith("*")) {
String parsed = getParsedText();
List<String> split = Arrays.asList(parsed.trim().split("\\s+"));
var lastWord = split.getLast();
return Optional.of(lastWord + "*"); // * is removed by getParsedText()
}
}
return Optional.empty();
}
Expand Down

0 comments on commit f326889

Please sign in to comment.