aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/test/firebase/firestore/immutable/testing.h
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/core/test/firebase/firestore/immutable/testing.h')
-rw-r--r--Firestore/core/test/firebase/firestore/immutable/testing.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/Firestore/core/test/firebase/firestore/immutable/testing.h b/Firestore/core/test/firebase/firestore/immutable/testing.h
index 337140f..0b25b66 100644
--- a/Firestore/core/test/firebase/firestore/immutable/testing.h
+++ b/Firestore/core/test/firebase/firestore/immutable/testing.h
@@ -144,16 +144,26 @@ Container ToMap(const std::vector<int>& values) {
return result;
}
+template <typename Container>
+std::vector<int> Keys(const Container& container) {
+ std::vector<int> keys;
+ for (const auto& element : container) {
+ keys.push_back(element.first);
+ }
+ return keys;
+}
+
/**
* Appends the contents of the given container to a new vector.
*/
template <typename Container>
-std::vector<typename Container::value_type> Append(const Container& container) {
+std::vector<typename Container::value_type> Collect(
+ const Container& container) {
return {container.begin(), container.end()};
}
-#define ASSERT_SEQ_EQ(x, y) ASSERT_EQ((x), Append(y));
-#define EXPECT_SEQ_EQ(x, y) EXPECT_EQ((x), Append(y));
+#define ASSERT_SEQ_EQ(x, y) ASSERT_EQ((x), Collect(y));
+#define EXPECT_SEQ_EQ(x, y) EXPECT_EQ((x), Collect(y));
} // namespace immutable
} // namespace firestore