-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strip colors from search term #4044
Strip colors from search term #4044
Conversation
Your Pull Request was automatically labelled as: "✨ Fix" |
...main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java
Outdated
Show resolved
Hide resolved
Slimefun preview buildA Slimefun preview build is available for testing! https://preview-builds.walshy.dev/download/Slimefun/4044/e876ec14
|
we've had searching forever and coloured chat is common, how has this not been hit before? |
no idea |
I'd love a test for this, should be easy enough to do. |
can do, just got on my computer |
Just made the test, I ran said test with and without my changes and without the change it fails on the colored query but with my change it doesn't, if there's a better way to do the test lmk but this is what I could think of lol |
src/test/java/io/github/thebusybiscuit/slimefun4/core/guide/TestGuideOpening.java
Show resolved
Hide resolved
src/test/java/io/github/thebusybiscuit/slimefun4/core/guide/TestGuideOpening.java
Outdated
Show resolved
Hide resolved
src/test/java/io/github/thebusybiscuit/slimefun4/core/guide/TestGuideOpening.java
Show resolved
Hide resolved
src/test/java/io/github/thebusybiscuit/slimefun4/core/guide/TestGuideOpening.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blame Walshy if tests fail
Description
To allow any servers that have colored chat to still use the slimefun search system
Proposed changes
SurvivalSlimefunGuide#openSearch
whensearchTerm
is defined I wrapped it withChatColor#stripColor
TestGuideOpening
I changedtestOpenSearch
totestOpenSearchHistory
to better reflect the testTestGuideOpening
I created a newtestOpenSearch
method that tests with a normal, and then colored version of the same search. It opens the search for both and asserts that the item registered that should be found by the search is in the upper inventory (where the search would be displayed)Related Issues (if applicable)
Resolves #4043
Checklist
Nonnull
andNullable
annotations to my methods to indicate their behaviour for null values