about summary refs log tree commit diff
path: root/third_party/nix/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/tests')
-rw-r--r--third_party/nix/src/tests/attr-set.cc1
-rw-r--r--third_party/nix/src/tests/derivations_test.cc11
2 files changed, 12 insertions, 0 deletions
diff --git a/third_party/nix/src/tests/attr-set.cc b/third_party/nix/src/tests/attr-set.cc
index ae323e6bd3d3..17234f6b316b 100644
--- a/third_party/nix/src/tests/attr-set.cc
+++ b/third_party/nix/src/tests/attr-set.cc
@@ -5,6 +5,7 @@
 #include <string>
 #include <vector>
 
+#include <absl/container/btree_map.h>
 #include <bits/stdint-intn.h>
 #include <gc/gc_cpp.h>
 #include <gtest/gtest.h>
diff --git a/third_party/nix/src/tests/derivations_test.cc b/third_party/nix/src/tests/derivations_test.cc
index 1e2719addaf1..63e2c3070e3e 100644
--- a/third_party/nix/src/tests/derivations_test.cc
+++ b/third_party/nix/src/tests/derivations_test.cc
@@ -22,6 +22,17 @@ namespace rc {
 using nix::Derivation;
 using nix::DerivationOutput;
 
+template <class K, class V>
+struct Arbitrary<absl::btree_map<K, V>> {
+  static Gen<absl::btree_map<K, V>> arbitrary() {
+    return gen::map(gen::arbitrary<std::map<K, V>>(), [](std::map<K, V> map) {
+      absl::btree_map<K, V> out_map;
+      out_map.insert(map.begin(), map.end());
+      return out_map;
+    });
+  }
+};
+
 template <>
 struct Arbitrary<nix::Base> {
   static Gen<nix::Base> arbitrary() {