Merge pull request #7872 from obsidiansystems/test-derivation-to-json

`Derivation::toJSON`: fix bug!
This commit is contained in:
tomberek 2023-02-20 18:12:09 -05:00 committed by GitHub
commit 5510daf132
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -945,6 +945,7 @@ nlohmann::json Derivation::toJSON(const Store & store) const
res["system"] = platform;
res["builder"] = builder;
res["args"] = args;
res["env"] = env;
return res;
}

View file

@ -85,6 +85,9 @@ TEST_JSON(Derivation, impure,
"bar",
"baz"
],
"env": {
"BIG_BAD": "WOLF"
},
"outputs": {}
})",
({
@ -107,6 +110,12 @@ TEST_JSON(Derivation, impure,
"bar",
"baz",
};
drv.env = {
{
"BIG_BAD",
"WOLF",
},
};
drv;
}))