Huge refactor; Passing tests

This commit is contained in:
GHXX committed 2024-01-13 01:31:30 +01:00
1 parent 3e307c27fa
commit 09fa3b8734
18 files changed
+577 -162

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
global using static SimpleHttpServer.GlobalUsings;
using SimpleHttpServer.Types.Exceptions;
using System.Diagnostics.CodeAnalysis;
namespace SimpleHttpServer;
internal static class GlobalUsings {
internal static void Assert([DoesNotReturnIf(false)] bool b, string? message = null) {
if (!b) {
if (message == null)
throw new AssertionFailedException("An assertion has failed!");
else
throw new AssertionFailedException($"An assertion has failed: {message}");
}
}
internal static void AssertImplies(bool x, bool y, string? message = null) => Assert(!x || y, message);
}