From fd88bde403caf8984b96aa35ae1ea1b71f4e3277 Mon Sep 17 00:00:00 2001 From: GHXX Date: Sun, 11 Aug 2024 04:43:42 +0200 Subject: [PATCH] make assertions more debug friendly --- SimpleHttpServer/GlobalUsings.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SimpleHttpServer/GlobalUsings.cs b/SimpleHttpServer/GlobalUsings.cs index 89a0ee2..b1fca3d 100644 --- a/SimpleHttpServer/GlobalUsings.cs +++ b/SimpleHttpServer/GlobalUsings.cs @@ -1,9 +1,12 @@ global using static SimpleHttpServer.GlobalUsings; using SimpleHttpServer.Types.Exceptions; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; namespace SimpleHttpServer; internal static class GlobalUsings { + + [DebuggerHidden] internal static void Assert([DoesNotReturnIf(false)] bool b, string? message = null) { if (!b) { if (message == null) @@ -13,5 +16,6 @@ internal static class GlobalUsings { } } + [DebuggerHidden] internal static void AssertImplies(bool x, bool y, string? message = null) => Assert(!x || y, message); }