From e74f906b12b59eaecda65d6de86f1263656c17be Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Wed, 22 Nov 2023 11:50:48 +0200 Subject: [PATCH] Core (unit tests) - Added a unit test for `RUSTACEAN_SIMPLE` --- source/gogga/core.d | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/source/gogga/core.d b/source/gogga/core.d index 56332ea..807cf20 100644 --- a/source/gogga/core.d +++ b/source/gogga/core.d @@ -341,6 +341,27 @@ unittest gLogger.enableDebug(); gLogger.dbg("This is a VISIBLE debug", true); + // Make space between unit tests + writeln(); +} + +unittest +{ + GoggaLogger gLogger = new GoggaLogger(); + gLogger.mode(GoggaMode.RUSTACEAN_SIMPLE); + + // Test the normal modes + gLogger.info("This is an info message"); + gLogger.warn("This is a warning message"); + gLogger.error("This is an error message"); + + // We shouldn't see anything as debug is off + gLogger.dbg("This is a debug which is hidden", 1); + + // Now enable debugging and you should see it + gLogger.enableDebug(); + gLogger.dbg("This is a VISIBLE debug", true); + // Make space between unit tests writeln(); } \ No newline at end of file