diff --git a/src/libstore/dummy-store.cc b/src/libstore/dummy-store.cc index 57bbcd231..852c38b75 100644 --- a/src/libstore/dummy-store.cc +++ b/src/libstore/dummy-store.cc @@ -16,6 +16,16 @@ std::string DummyStoreConfig::doc() ; } +bool DummyStore::PathInfoAndContents::operator==(const PathInfoAndContents & other) const +{ + return info == other.info && contents->root == other.contents->root; +} + +bool DummyStore::operator==(const DummyStore & other) const +{ + return contents == other.contents && derivations == other.derivations && buildTrace == other.buildTrace; +} + namespace { class WholeStoreViewAccessor : public SourceAccessor diff --git a/src/libstore/include/nix/store/dummy-store-impl.hh b/src/libstore/include/nix/store/dummy-store-impl.hh index 095767aaf..9b078eeaa 100644 --- a/src/libstore/include/nix/store/dummy-store-impl.hh +++ b/src/libstore/include/nix/store/dummy-store-impl.hh @@ -23,6 +23,8 @@ struct DummyStore : virtual Store { UnkeyedValidPathInfo info; ref contents; + + bool operator==(const PathInfoAndContents &) const; }; /** @@ -54,6 +56,8 @@ struct DummyStore : virtual Store , config(config) { } + + bool operator==(const DummyStore &) const; }; } // namespace nix