1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 15:48:00 +02:00

Fix eval tests

This commit is contained in:
Eelco Dolstra 2022-05-11 13:45:24 +02:00
parent 087584ef4d
commit 95e4376434
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
4 changed files with 21 additions and 13 deletions

View file

@ -1461,12 +1461,15 @@ static RegisterPrimOp primop_baseNameOf({
static void prim_dirOf(EvalState & state, const PosIdx pos, Value * * args, Value & v)
{
PathSet context;
auto path = state.coerceToString(pos, *args[0], context, false, false);
auto dir = dirOf(*path);
abort();
#if 0
if (args[0]->type() == nPath) v.mkPath(dir); else v.mkString(dir, context);
#endif
state.forceValue(*args[0], pos);
if (args[0]->type() == nPath) {
auto path = args[0]->path();
v.mkPath({path.accessor, dirOf(path.path)});
} else {
auto path = state.coerceToString(pos, *args[0], context, false, false);
auto dir = dirOf(*path);
v.mkString(dir, context);
}
}
static RegisterPrimOp primop_dirOf({