mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2025-09-05 17:07:06 +02:00
remove regex replacer & associated tests
This commit is contained in:
@@ -37,12 +37,6 @@ public final class ReplacerUnitTester {
|
||||
Values.CHARS_REPLACER.apply("%player_name%", null, Values.PLACEHOLDERS::get));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testRegexReplacerProducesExpectedSingleValue() {
|
||||
assertEquals(PLAYER_NAME,
|
||||
Values.REGEX_REPLACER.apply("%player_name%", null, Values.PLACEHOLDERS::get));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCharsReplacerProducesExpectedSentence() {
|
||||
assertEquals(String.format(
|
||||
@@ -51,36 +45,14 @@ public final class ReplacerUnitTester {
|
||||
Values.CHARS_REPLACER.apply(Values.LARGE_TEXT, null, Values.PLACEHOLDERS::get));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testRegexReplacerProducesExpectedSentence() {
|
||||
assertEquals(String.format(
|
||||
"My name is %s and my location is (%s, %s, %s), this placeholder is invalid %%server_name%%",
|
||||
PLAYER_NAME, PLAYER_X, PLAYER_Y, PLAYER_Z),
|
||||
Values.REGEX_REPLACER.apply(Values.LARGE_TEXT, null, Values.PLACEHOLDERS::get));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testResultsAreTheSameAsReplacement() {
|
||||
final String resultChars = Values.CHARS_REPLACER
|
||||
.apply("%player_name%", null, Values.PLACEHOLDERS::get);
|
||||
final String resultRegex = Values.REGEX_REPLACER
|
||||
.apply("%player_name%", null, Values.PLACEHOLDERS::get);
|
||||
|
||||
assertEquals(resultChars, resultRegex);
|
||||
|
||||
assertEquals(PLAYER_NAME, resultChars);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testResultsAreTheSameNoReplacement() {
|
||||
final String resultChars = Values.CHARS_REPLACER
|
||||
.apply("%player_location%", null, Values.PLACEHOLDERS::get);
|
||||
final String resultRegex = Values.REGEX_REPLACER
|
||||
.apply("%player_location%", null, Values.PLACEHOLDERS::get);
|
||||
|
||||
assertEquals(resultChars, resultRegex);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCharsReplacerIgnoresMalformed() {
|
||||
final String text = "10% and %hello world 15%";
|
||||
|
Reference in New Issue
Block a user