+ * Sometimes, the color code can be accidentally removed as people see + * it as part of the word on first look. This test is designed to catch + * these cases. It is not perfect but it does catch a few instances. + *
+ * The test checks for color chars (ampersands) that have no follow-up + * chatcolor key but rather a preceeding one. + *
+ * The test will catch occurences like "a& ", "b&Hello" or "7&", "5& a".
+ * The test will however ignore valid color codes such as "a&a".
+ *
+ * @author TheBusyBiscuit
+ *
+ */
+class TestColorCodes extends AbstractLocaleRegexChecker {
+
+ TestColorCodes() {
+ super(Pattern.compile("[a-f0-9klmno]&[^a-f0-9klmno]"));
+ }
+
+ @ParameterizedTest
+ @ParametersAreNonnullByDefault
+ @MethodSource("getAllLanguageFiles")
+ @DisplayName("Test for mistakes in color codes for Slimefun locale files")
+ void testSpelling(LanguagePreset lang, LanguageFile file) throws IOException {
+ try (BufferedReader reader = readLanguageFile(lang, file)) {
+ if (reader == null) {
+ return;
+ }
+
+ FileConfiguration config = YamlConfiguration.loadConfiguration(reader);
+ assertNoRegexMatchesForAllEntries(lang, file, config);
+ }
+ }
+
+}
diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestSlimefunItem.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestSlimefunItem.java
index 63fc9669a1..c3e02edf47 100644
--- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestSlimefunItem.java
+++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestSlimefunItem.java
@@ -53,7 +53,7 @@ void testWikiPages() {
Optional