Huge refactor; Passing tests
This commit is contained in:
1 parent
3e307c27fa
commit
09fa3b8734
18 files changed
+577
-162
No files matched your search
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user