Add testutils module with assert_eq()

This commit is contained in:
josh committed 2023-07-14 15:48:44 -04:00
1 parent 5ce562cbc3
commit 653b4e00f6
2 files changed
+11 -1

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
import std.stdio;
void assert_eq(T)(T expected, T actual, string file = __FILE__, size_t line = __LINE__)
{
if (expected != actual)
{
stderr.writeln(file, ":", line, ": expected ", expected, ", got ", actual);
assert(false);
}
}