Add testutils module with assert_eq()
This commit is contained in:
1 parent
5ce562cbc3
commit
653b4e00f6
2 files changed
+11
-1
No files matched your search
@@ -27,7 +27,7 @@ describe Propane do
|
||||
parsers = options[:parsers].map do |name|
|
||||
"spec/run/testparser#{name}.d"
|
||||
end
|
||||
result = system(*%w[ldc2 --unittest -of spec/run/testparser -Ispec], *parsers, *test_files)
|
||||
result = system(*%w[ldc2 --unittest -of spec/run/testparser -Ispec], *parsers, *test_files, "spec/testutils.d")
|
||||
expect(result).to be_truthy
|
||||
end
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user