diff --git a/TShockLauncher.Tests/ChatTests.cs b/TShockLauncher.Tests/ChatTests.cs
new file mode 100644
index 00000000..71869818
--- /dev/null
+++ b/TShockLauncher.Tests/ChatTests.cs
@@ -0,0 +1,30 @@
+using Microsoft.Xna.Framework;
+using NUnit.Framework;
+using Terraria.UI.Chat;
+
+namespace TShockLauncher.Tests;
+
+public class ChatTests
+{
+ ///
+ /// Ensures that the does not cause exceptions when used on the server.
+ ///
+ ///
+ /// The behaviour of TShock regarding the achievement tag handler changes depending on if TShock has
+ /// a instance or not. Therefore, we do not check the correctness of the parsed message, but only if it
+ /// throws an exception.
+ ///
+ [TestCase]
+ public void TestChatAchievementTagHandler()
+ {
+ Assert.That(() =>
+ {
+ ChatManager.ParseMessage("No achievement tags", Color.White);
+ ChatManager.ParseMessage("One achievement tag: [a:KILL_THE_SUN]", Color.White);
+ ChatManager.ParseMessage("One achievement tag, using the longer variant: [achievement:KILL_THE_SUN]", Color.White);
+ ChatManager.ParseMessage("Multiple achievement tags: [a:KILL_THE_SUN] and [a:TOPPED_OFF]", Color.White);
+ ChatManager.ParseMessage("One achievement tag, referring to a non-existent achievement: [a:_THIS_WILL_NEVER_EXIST_]", Color.White);
+ ChatManager.ParseMessage("Both valid and invalid achievement tags: [a:KILL_THE_SUN] and [a:_THIS_WILL_NEVER_EXIST_]", Color.White);
+ }, Throws.Nothing);
+ }
+}
diff --git a/TShockLauncher.Tests/TestSetup.cs b/TShockLauncher.Tests/TestSetup.cs
index 0e4abb42..016f2679 100644
--- a/TShockLauncher.Tests/TestSetup.cs
+++ b/TShockLauncher.Tests/TestSetup.cs
@@ -1,5 +1,6 @@
using NUnit.Framework;
using Terraria;
+using Terraria.Initializers;
using Terraria.Localization;
using TShockAPI;
@@ -15,6 +16,8 @@ public class TestSetup
[OneTimeSetUp]
public static void SetupTShock()
{
+ ChatInitializer.Load();
+
Program.SavePath = ""; // 1.4.4.2 staticness introduced this where by default it is null, and any touch to Terraria.Main will use it and cause a crash.
LanguageManager.Instance.SetLanguage(GameCulture.DefaultCulture); // TShockAPI.Localization will fail without ActiveCulture set
Lang.InitializeLegacyLocalization(); // TShockAPI.Localization will fail without preparing NPC names etc