aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/value/context.hh
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-01-29 13:52:38 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-01-29 17:09:59 -0500
commitecd3e4ebd777dca694d0c60431641f054ec2d1ce (patch)
treee11a073f6cf5baa207a9da8bf2f8e2bb200c3ab9 /src/libexpr/value/context.hh
parentec0c0efec6d7eed868b424434748b97651e02bcc (diff)
More property tests
Also put proper comparison methods on `DerivedPath` and `NixStringContextElem`, which is needed for the tests but good in general.
Diffstat (limited to 'src/libexpr/value/context.hh')
-rw-r--r--src/libexpr/value/context.hh17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/libexpr/value/context.hh b/src/libexpr/value/context.hh
index d8008c436..721563cba 100644
--- a/src/libexpr/value/context.hh
+++ b/src/libexpr/value/context.hh
@@ -1,9 +1,10 @@
#pragma once
#include "util.hh"
+#include "comparator.hh"
#include "path.hh"
-#include <optional>
+#include <variant>
#include <nlohmann/json_fwd.hpp>
@@ -31,7 +32,9 @@ class Store;
Encoded as just the path: ‘<path>’.
*/
struct NixStringContextElem_Opaque {
- StorePath path;
+ StorePath path;
+
+ GENERATE_CMP(NixStringContextElem_Opaque, me->path);
};
/* Path to a derivation and its entire build closure.
@@ -43,7 +46,9 @@ struct NixStringContextElem_Opaque {
Encoded in the form ‘=<drvPath>’.
*/
struct NixStringContextElem_DrvDeep {
- StorePath drvPath;
+ StorePath drvPath;
+
+ GENERATE_CMP(NixStringContextElem_DrvDeep, me->drvPath);
};
/* Derivation output.
@@ -51,8 +56,10 @@ struct NixStringContextElem_DrvDeep {
Encoded in the form ‘!<output>!<drvPath>’.
*/
struct NixStringContextElem_Built {
- StorePath drvPath;
- std::string output;
+ StorePath drvPath;
+ std::string output;
+
+ GENERATE_CMP(NixStringContextElem_Built, me->drvPath, me->output);
};
using _NixStringContextElem_Raw = std::variant<