-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert hex legacy chars to MiniMessage too
- Loading branch information
1 parent
74b6c20
commit 5de4f21
Showing
4 changed files
with
71 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
36 changes: 36 additions & 0 deletions
36
api/src/test/java/net/pistonmaster/pistonmotd/api/ConversionTest.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package net.pistonmaster.pistonmotd.api; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class ConversionTest { | ||
@Test | ||
public void testBasicConversionSection() { | ||
Assertions.assertEquals("<red>Hello World", PlaceholderUtil.convertMiniMessageString("§cHello World")); | ||
} | ||
|
||
@Test | ||
public void testBasicConversionAmpersand() { | ||
Assertions.assertEquals("<red>Hello World", PlaceholderUtil.convertMiniMessageString("&cHello World")); | ||
} | ||
|
||
@Test | ||
public void testBasicConversionHexSection() { | ||
Assertions.assertEquals("<#ff0000>Hello World", PlaceholderUtil.convertMiniMessageString("§#ff0000Hello World")); | ||
} | ||
|
||
@Test | ||
public void testBasicConversionHexAmpersand() { | ||
Assertions.assertEquals("<#ff0000>Hello World", PlaceholderUtil.convertMiniMessageString("&#ff0000Hello World")); | ||
} | ||
|
||
@Test | ||
public void testBasicConversionHexSectionUgly() { | ||
Assertions.assertEquals("<#ff0000>Hello World", PlaceholderUtil.convertMiniMessageString("§x§f§f§0§0§0§0Hello World")); | ||
} | ||
|
||
@Test | ||
public void testBasicConversionHexAmpersandUgly() { | ||
Assertions.assertEquals("<#ff0000>Hello World", PlaceholderUtil.convertMiniMessageString("&x&f&f&0&0&0&0Hello World")); | ||
} | ||
} |
This file contains 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
This file contains 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