tint: Add utils::UniqueVector::data()

Change-Id: Ibbd4f595c5fdaacf93c13757878ed06675e735c6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91022
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/src/tint/utils/unique_vector_test.cc b/src/tint/utils/unique_vector_test.cc
index 7d586e9..035ebf8 100644
--- a/src/tint/utils/unique_vector_test.cc
+++ b/src/tint/utils/unique_vector_test.cc
@@ -139,5 +139,14 @@
     EXPECT_EQ(unique_vec.empty(), true);
 }
 
+TEST(UniqueVectorTest, Data) {
+    UniqueVector<int> unique_vec;
+    EXPECT_EQ(unique_vec.data(), nullptr);
+
+    unique_vec.add(42);
+    EXPECT_EQ(unique_vec.data(), &unique_vec[0]);
+    EXPECT_EQ(*unique_vec.data(), 42);
+}
+
 }  // namespace
 }  // namespace tint::utils