Skip to content

Commit 2d18633

Browse files
monyarmPetarKirov
authored andcommitted
feat(mcl/utils/nix): Add assert failure error msg
1 parent 9e2d46a commit 2d18633

File tree

1 file changed

+5
-2
lines changed
  • packages/mcl/src/src/mcl/utils

1 file changed

+5
-2
lines changed

packages/mcl/src/src/mcl/utils/nix.d

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ unittest
256256
auto p = __FILE__.absolutePath.dirName;
257257

258258
string output = nix().run(p ~ "/test/test.nix", [ "--file"]);
259-
assert(output == "Hello World");
259+
assert(output == "Hello World", "Expected 'Hello World', got: " ~ output);
260260
}
261261

262262
@("nix.build!JSONValue")
@@ -266,10 +266,13 @@ unittest
266266
import std.range : front;
267267

268268
import std.path : absolutePath, dirName;
269+
import std.json : JSONType;
269270

270271
auto p = __FILE__.absolutePath.dirName;
271272

272-
JSONValue output = nix().build!JSONValue(p ~ "/test/test.nix", ["--file"]).array.front;
273+
JSONValue output = nix().build!JSONValue(p ~ "/test/test.nix", ["--file"]);
274+
assert(output.type == JSONType.array, "Expected an array, got: " ~ output.type.to!string);
275+
output = output.array.front;
273276
assert(execute([output["outputs"]["out"].str ~ "/bin/helloWorld"]).strip == "Hello World");
274277
}
275278

0 commit comments

Comments
 (0)