From 3c6ee2bbbb5294fca858d3e4a74460342cb24021 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Fri, 17 Mar 2023 09:11:22 +0200 Subject: [PATCH] Unit tests - Added another unit test --- source/birchwood/protocol/messages.d | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/birchwood/protocol/messages.d b/source/birchwood/protocol/messages.d index cbc411d..c088e70 100644 --- a/source/birchwood/protocol/messages.d +++ b/source/birchwood/protocol/messages.d @@ -321,6 +321,19 @@ public final class Message assert(cmp(splitted[2], "Hello this is text") == 0); } + unittest + { + import std.stdio; + + string testInput = ":Hello this is text"; + bool hasTrailer; + string[] splitted = splitting(testInput, hasTrailer); + + /* Trailer test */ + assert(hasTrailer); + assert(cmp(splitted[0], "Hello this is text") == 0); + } + /** * Imagine: `A:=1 A=2 :Hello` *