summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorrmichela <deltahat@gmail.com>2012-03-16 00:40:47 -0400
committerEvilSeph <evilseph@gmail.com>2012-03-16 02:48:54 -0400
commit606f33903c245615fe9906778741ccfcf6677ac7 (patch)
tree49ff83eb02826934f171fdd9ff34a4aa532355a4 /src/test
parent776745c3352de7c11539e5417e5d9288cf7e670c (diff)
downloadbukkit-606f33903c245615fe9906778741ccfcf6677ac7.tar
bukkit-606f33903c245615fe9906778741ccfcf6677ac7.tar.gz
bukkit-606f33903c245615fe9906778741ccfcf6677ac7.tar.lz
bukkit-606f33903c245615fe9906778741ccfcf6677ac7.tar.xz
bukkit-606f33903c245615fe9906778741ccfcf6677ac7.zip
[Bleeding] Added ChatColor.translateAlternateColorCodes(). Addresses BUKKIT-1191
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/bukkit/ChatColorTest.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/java/org/bukkit/ChatColorTest.java b/src/test/java/org/bukkit/ChatColorTest.java
index d721c4f1..ed700020 100644
--- a/src/test/java/org/bukkit/ChatColorTest.java
+++ b/src/test/java/org/bukkit/ChatColorTest.java
@@ -62,4 +62,12 @@ public class ChatColorTest {
assertThat(String.format("%c%c", ChatColor.COLOR_CHAR, color.getChar()), is(color.toString()));
}
}
+
+ @Test
+ public void translateAlternateColorCodes() {
+ String s = "&0&1&2&3&4&5&6&7&8&9&A&a&B&b&C&c&D&d&E&e&F&f&K&k & more";
+ String t = ChatColor.translateAlternateColorCodes('&', s);
+ String u = ChatColor.BLACK.toString() + ChatColor.DARK_BLUE + ChatColor.DARK_GREEN + ChatColor.DARK_AQUA + ChatColor.DARK_RED + ChatColor.DARK_PURPLE + ChatColor.GOLD + ChatColor.GRAY + ChatColor.DARK_GRAY + ChatColor.BLUE + ChatColor.GREEN + ChatColor.GREEN + ChatColor.AQUA + ChatColor.AQUA + ChatColor.RED + ChatColor.RED + ChatColor.LIGHT_PURPLE + ChatColor.LIGHT_PURPLE + ChatColor.YELLOW + ChatColor.YELLOW + ChatColor.WHITE + ChatColor.WHITE + ChatColor.MAGIC + ChatColor.MAGIC + " & more";
+ assertThat(t, is(u));
+ }
}