diff --git a/source/birchwood/protocol/messages.d b/source/birchwood/protocol/messages.d index 603708e..e91226e 100644 --- a/source/birchwood/protocol/messages.d +++ b/source/birchwood/protocol/messages.d @@ -608,4 +608,17 @@ public final class Message { return replyType; } +} + +version(unittest) +{ + // Contains illegal characters + string badString1 = "doos"~"bruh"~"lek"~cast(string)[10]~"ker"; + string badString2 = "doos"~"bruh"~"lek"~cast(string)[13]~"ker"; +} + +unittest +{ + assert(Message.hasIllegalCharacters(badString1) == true); + assert(Message.hasIllegalCharacters(badString2) == true); } \ No newline at end of file